OFFSET
2,1
COMMENTS
All positive Jacobsthal numbers are odd, so the index starts at n = 2.
The set of primitive prime factors of J_k is given by {A000040(j) | a(j) = k}.
LINKS
Eric Weisstein's World of Mathematics, Primitive Prime Factor
FORMULA
a(n) = 1 (mod A000040(n)) for n > 2.
EXAMPLE
The 4th prime number is 7, and 7 divides 21 which is Jacobsthal(6), so a(4) = 6. The second prime number, 3, divides Jacobsthal(6) as well, but it divides also the smaller Jacobsthal(3), i.e., a(2) = 3.
MATHEMATICA
m = 300; j = LinearRecurrence[{1, 2}, {3, 5}, m]; s = {}; p = 3; While[(ind = Select[Range[m], Divisible[j[[#]], p] &, 1]) != {}, AppendTo[s, ind[[1]] + 2]; p = NextPrime[p]]; s (* Amiram Eldar, Sep 28 2020 *)
PROG
(Python)
n = 1
while n < 63:
n, J0, J1, a = n+1, 3, 1, 3
p = A000040(n)
J0 = J0%p
while J0 != 0:
J0, J1, a = (J0+2*J1)%p, J0, a+1
print(n, a)
(PARI) J(n) = (2^n - (-1)^n)/3; \\ A001045
a(n) = {my(k=1, p=prime(n)); while (J(k) % p, k++); k; } \\ Michel Marcus, Sep 29 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
A.H.M. Smeets, Sep 27 2020
STATUS
approved