login
a(1) = 1. For n >= 2, add to a(n-1) its prime or nonprime index to obtain a(n).
0

%I #50 Sep 26 2022 20:44:07

%S 1,2,3,5,8,12,19,27,45,76,131,163,201,356,641,757,891,1628,2998,5567,

%T 10400,19526,36838,69770,132623,145002,276582,528994,1014241,1948927,

%U 2094369,4033308,7781263,15036531,29100147,56394812,109429140,212585890,413435408,804856919,846240101

%N a(1) = 1. For n >= 2, add to a(n-1) its prime or nonprime index to obtain a(n).

%C 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?

%e 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.

%e a(n) Prime index Nonprime index

%e 1 - 1

%e 2 1 -

%e 3 2 -

%e 5 3 -

%e 8 - 4

%e 12 - 7

%e 19 8 -

%e .............................

%o (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

%Y Cf. A000040, A018252.

%K nonn

%O 1,2

%A _Tamas Sandor Nagy_, Jul 26 2022

%E a(14)-a(30) from _Thomas Scheuerle_, Jul 26 2022

%E More terms from _David A. Corneth_, Jul 26 2022