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 A376596 #11 Oct 03 2024 08:32:02 %S A376596 0,0,0,1,-1,0,1,0,1,-2,1,2,-2,0,0,0,-1,4,-1,-2,2,-2,2,2,-4,1,0,1,-2,4, %T A376596 -4,0,4,2,-4,-2,2,-2,2,4,-4,-2,-1,2,3,-4,8,-8,4,0,-2,-2,2,2,-4,8,-8,2, %U A376596 -2,10,0,-8,-2,2,2,-4,0,6,-3,-4,5,0,-4,4,-2,-2 %N A376596 Second differences of consecutive prime-powers inclusive (A000961). First differences of A057820. %C A376596 For the exclusive version, shift left once. %e A376596 The prime-powers inclusive (A000961) are: %e A376596 1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 37, 41, 43, ... %e A376596 with first differences (A057820): %e A376596 1, 1, 1, 1, 2, 1, 1, 2, 2, 3, 1, 2, 4, 2, 2, 2, 2, 1, 5, 4, 2, 4, 2, 4, 6, 2, 3, ... %e A376596 with first differences (A376596): %e A376596 0, 0, 0, 1, -1, 0, 1, 0, 1, -2, 1, 2, -2, 0, 0, 0, -1, 4, -1, -2, 2, -2, 2, 2, ... %t A376596 Differences[Select[Range[1000],#==1||PrimePowerQ[#]&],2] %o A376596 (Python) %o A376596 from sympy import primepi, integer_nthroot %o A376596 def A376596(n): %o A376596 def iterfun(f,n=0): %o A376596 m, k = n, f(n) %o A376596 while m != k: m, k = k, f(k) %o A376596 return m %o A376596 def f(x): return int(n+x-1-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length()))) %o A376596 return (a:=iterfun(f,n))-((b:=iterfun(lambda x:f(x)+1,a))<<1)+iterfun(lambda x:f(x)+2,b) # _Chai Wah Wu_, Oct 02 2024 %Y A376596 The version for A000002 is A376604, first differences of A054354. %Y A376596 For first differences we had A057820, sorted firsts A376340(n)+1 (except first term). %Y A376596 Positions of zeros are A376597, complement A376598. %Y A376596 Sorted positions of first appearances are A376653, exclusive A376654. %Y A376596 A000961 lists prime-powers inclusive, exclusive A246655. %Y A376596 A001597 lists perfect-powers, complement A007916. %Y A376596 A023893 and A023894 count integer partitions into prime-powers, factorizations A000688. %Y A376596 A064113 lists positions of adjacent equal prime gaps. %Y A376596 For prime-powers inclusive: A057820 (first differences), A376597 (inflections and undulations), A376598 (nonzero curvature). %Y A376596 For second differences: A036263 (prime), A073445 (composite), A376559 (perfect-power), A376562 (non-perfect-power), A376590 (squarefree), A376593 (nonsquarefree), A376599 (non-prime-power). %Y A376596 Cf. A025475, A045542, A053707, A069623, A093555, A174965, A251092, A333254, A336416, A361102. %K A376596 sign %O A376596 1,10 %A A376596 _Gus Wiseman_, Oct 02 2024