This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A378500 #39 Dec 06 2024 16:28:19 %S A378500 2,0,3,1,4,2,5,3,6,4,7,5,8,6,8,6,9,7,10,8,10,8,11,9,12,10,13,11,14,12, %T A378500 15,13,15,13,15,13,16,14,16,14,17,15,18,16,18,16,19,17,20,18,20,18,21, %U A378500 19,21,19,21,19,22,20,23,21,23,21,23,21,24,22,24,22,25 %N A378500 a(1) = 2, then a(n) = a(n-1) - 2 for n even, a(n) = a(n-1) + 3 for n an odd prime or odd prime power, and a(n) = a(n-1) + 2 otherwise. %C A378500 Asymptotically the sequence should reach long periods of stasis, with rare increases with each new prime so as to yield a strict permutation of the positive integers if duplicates are removed. %H A378500 Bill McEachen, <a href="/A378500/b378500.txt">Table of n, a(n) for n = 1..10000</a> %F A378500 a(n) = a(n-1) - 2 for n even. %F A378500 a(n) = a(n-1) + 3 for n an odd prime or odd prime power. %F A378500 a(n) = a(n-1) + 2 for n an odd composite not a prime power. %F A378500 a(n) ~ n/log n. - _Charles R Greathouse IV_, Dec 01 2024 %e A378500 3 is prime so a(3) = a(2) + 3 = 0 + 3 = 3. 4 is even so a(4) = a(3) - 2 = 3 - 2 = 1. %t A378500 Module[{n = 1}, NestList[# + Which[EvenQ[++n], -2, PrimePowerQ[n], 3, True, 2] &, 2, 100]] (* _Paolo Xausa_, Dec 06 2024 *) %o A378500 (PARI) first(n)=my(v=vector(n)); v[1]=2; for(k=2,n, v[k]=v[k-1]+if(k%2==0, -2, isprimepower(k), 3, 2)); v \\ _Charles R Greathouse IV_, Dec 01 2024 %K A378500 nonn %O A378500 1,1 %A A378500 _Bill McEachen_, Nov 30 2024 %E A378500 Corrected by _Charles R Greathouse IV_, Dec 01 2024