cp's OEIS Frontend

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.

A057820 First differences of sequence of consecutive prime powers (A000961).

This page as a plain text file.
%I A057820 #44 Oct 11 2024 10:19:08
%S A057820 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,3,4,2,6,2,2,6,
%T A057820 8,4,2,4,2,4,8,4,2,1,3,6,2,10,2,6,6,4,2,4,6,2,10,2,4,2,12,12,4,2,4,6,
%U A057820 2,2,8,5,1,6,6,2,6,4,2,6,4,14,4,2,4,14,6,6,4,2,4,6,2,6,6,6,4,6,8,4,8,10,2,10
%N A057820 First differences of sequence of consecutive prime powers (A000961).
%C A057820 a(n) = 1 iff A000961(n) = A006549(k) for some k. - _Reinhard Zumkeller_, Aug 25 2002
%C A057820 Also run lengths of distinct terms in A070198. - _Reinhard Zumkeller_, Mar 01 2012
%C A057820 Does this sequence contain all positive integers? - _Gus Wiseman_, Oct 09 2024
%H A057820 Michael B. Porter, <a href="/A057820/b057820.txt">Table of n, a(n) for n = 1..10000</a>
%F A057820 a(n) = A000961(n+1) - A000961(n).
%e A057820 Odd differences arise in pairs in neighborhoods of powers of 2, like {..,2039,2048,2053,..} gives {..,11,5,..}
%p A057820 A057820 := proc(n)
%p A057820         A000961(n+1)-A000961(n) ;
%p A057820 end proc: # _R. J. Mathar_, Sep 23 2016
%t A057820 Map[Length, Split[Table[Apply[LCM, Range[n]], {n, 1, 150}]]] (* _Geoffrey Critzer_, May 29 2015 *)
%t A057820 Join[{1},Differences[Select[Range[500],PrimePowerQ]]] (* _Harvey P. Dale_, Apr 21 2022 *)
%o A057820 (PARI) isA000961(n) = (omega(n) == 1 || n == 1)
%o A057820 n_prev=1;for(n=2,500,if(isA000961(n),print(n-n_prev);n_prev=n)) \\ _Michael B. Porter_, Oct 30 2009
%o A057820 (Haskell)
%o A057820 a057820_list = zipWith (-) (tail a000961_list) a000961_list
%o A057820 -- _Reinhard Zumkeller_, Mar 01 2012
%o A057820 (Python)
%o A057820 from sympy import primepi, integer_nthroot
%o A057820 def A057820(n):
%o A057820     def f(x): return int(n+x-1-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
%o A057820     m, k = n, f(n)
%o A057820     while m != k: m, k = k, f(k)
%o A057820     r, k = m, f(m)+1
%o A057820     while r != k: r, k = k, f(k)+1
%o A057820     return r-m # _Chai Wah Wu_, Sep 12 2024
%Y A057820 Cf. A000961, A036616, A001223.
%Y A057820 For perfect-powers (A001597) we have A053289.
%Y A057820 For non-perfect-powers (A007916) we have A375706.
%Y A057820 Positions of ones are A375734.
%Y A057820 Run-compression is A376308.
%Y A057820 Run-lengths are A376309.
%Y A057820 Sorted positions of first appearances are A376340.
%Y A057820 The second (instead of first) differences are A376596, zeros A376597.
%Y A057820 Prime-powers:
%Y A057820 - terms: A000961 or A246655, complement A024619
%Y A057820 - differences: A057820 (this), first appearances A376341
%Y A057820 - runs: A373675, A373673, A373674, A174965
%Y A057820 - anti-runs: A373576, A120430, A006549, A373671
%Y A057820 Non-prime-powers:
%Y A057820 - terms: A361102
%Y A057820 - differences: A375708 (ones A375713)
%Y A057820 - runs: A373678, A373676, A373677, A110969 (A373669, sorted A373670)
%Y A057820 - anti-runs: A373679, A373575, A255346, A373672
%Y A057820 Cf. A000015, A014210, A014963, A025475, A025528, A027833, A037201, A046933, A076259, A078147, A093555, A345531, A376310.
%K A057820 nonn
%O A057820 1,5
%A A057820 _Labos Elemer_, Nov 08 2000
%E A057820 Offset corrected and b-file adjusted by _Reinhard Zumkeller_, Mar 03 2012