OFFSET
1,5
COMMENTS
Also run lengths of distinct terms in A070198. - Reinhard Zumkeller, Mar 01 2012
Does this sequence contain all positive integers? - Gus Wiseman, Oct 09 2024
LINKS
Michael B. Porter, Table of n, a(n) for n = 1..10000
EXAMPLE
Odd differences arise in pairs in neighborhoods of powers of 2, like {..,2039,2048,2053,..} gives {..,11,5,..}
MAPLE
MATHEMATICA
Map[Length, Split[Table[Apply[LCM, Range[n]], {n, 1, 150}]]] (* Geoffrey Critzer, May 29 2015 *)
Join[{1}, Differences[Select[Range[500], PrimePowerQ]]] (* Harvey P. Dale, Apr 21 2022 *)
PROG
(PARI) isA000961(n) = (omega(n) == 1 || n == 1)
n_prev=1; for(n=2, 500, if(isA000961(n), print(n-n_prev); n_prev=n)) \\ Michael B. Porter, Oct 30 2009
(Haskell)
a057820_list = zipWith (-) (tail a000961_list) a000961_list
-- Reinhard Zumkeller, Mar 01 2012
(Python)
from sympy import primepi, integer_nthroot
def A057820(n):
def f(x): return int(n+x-1-sum(primepi(integer_nthroot(x, k)[0]) for k in range(1, x.bit_length())))
m, k = n, f(n)
while m != k: m, k = k, f(k)
r, k = m, f(m)+1
while r != k: r, k = k, f(k)+1
return r-m # Chai Wah Wu, Sep 12 2024
CROSSREFS
Positions of ones are A375734.
Run-compression is A376308.
Run-lengths are A376309.
Sorted positions of first appearances are A376340.
Prime-powers:
Non-prime-powers:
- terms: A361102
KEYWORD
nonn
AUTHOR
Labos Elemer, Nov 08 2000
EXTENSIONS
Offset corrected and b-file adjusted by Reinhard Zumkeller, Mar 03 2012
STATUS
approved