login
A355975
a(1) = 1. For n >= 2, add to a(n-1) its prime or nonprime index to obtain a(n).
0
1, 2, 3, 5, 8, 12, 19, 27, 45, 76, 131, 163, 201, 356, 641, 757, 891, 1628, 2998, 5567, 10400, 19526, 36838, 69770, 132623, 145002, 276582, 528994, 1014241, 1948927, 2094369, 4033308, 7781263, 15036531, 29100147, 56394812, 109429140, 212585890, 413435408, 804856919, 846240101
OFFSET
1,2
COMMENTS
Two separate indices determine the progress of this sequence, like two parallel scales. What regularities or irregularities in the distribution of primes and nonprimes among the terms may emerge as the sequence grows?
EXAMPLE
Start with 1. As a nonprime, its index is 1. Add up the term and its index to get the next term, 2. This is a prime whose appropriate index is 1. The third term therefore is 2 + 1 = 3. And so on.
a(n) Prime index Nonprime index
1 - 1
2 1 -
3 2 -
5 3 -
8 - 4
12 - 7
19 8 -
.............................
PROG
(PARI) first(n) = { n = max(n, 1); print1(1", "); res = vector(n); res[1] = 1; for(i = 2, n, if(!isprime(res[i-1]), res[i] = 2*res[i-1] - primepi(res[i-1]) , res[i] = res[i-1] + primepi(res[i-1]) ); print1(res[i]", "); ); res } \\ David A. Corneth, Jul 26 2022
CROSSREFS
Sequence in context: A055804 A267372 A369696 * A327421 A124062 A274199
KEYWORD
nonn
AUTHOR
Tamas Sandor Nagy, Jul 26 2022
EXTENSIONS
a(14)-a(30) from Thomas Scheuerle, Jul 26 2022
More terms from David A. Corneth, Jul 26 2022
STATUS
approved