A376309 Run-lengths of the sequence of first differences of prime-powers.
3, 1, 2, 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2
Offset: 1
Keywords
Examples
The sequence of prime-powers (A246655) is: 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 37, ... The sequence of first differences (A057820) of prime-powers is: 1, 1, 1, 2, 1, 1, 2, 2, 3, 1, 2, 4, 2, 2, 2, 2, 1, 5, 4, 2, 4, 2, 4, ... with runs: (1,1,1),(2),(1,1),(2,2),(3),(1),(2),(4),(2,2,2,2),(1),(5),(4),(2),(4), ... with lengths A376309 (this sequence).
Links
- Antti Karttunen, Table of n, a(n) for n = 1..20000
Crossrefs
For runs of prime-powers increasing by one we have A174965.
For primes instead of prime-powers we have A333254.
For squarefree numbers instead of prime-powers we have A376306.
For compression instead of run-lengths we have A376308.
For run-sums instead of run-lengths we have A376310.
A373948 encodes compression using compositions in standard order.
Programs
-
Mathematica
Length/@Split[Differences[Select[Range[100],PrimePowerQ]]]
-
PARI
up_to = 20000; A376309list(up_to) = { my(v=vector(up_to), ppp=2, pd=1, d, rl=0, k=2, i=0); while(i<#v, k++; if(isprimepower(k), d = k-ppp; ppp = k; if(d == pd, rl++, i++; v[i] = rl; rl = 1; pd = d))); (v); }; v376309 = A376309list(up_to); A376309(n) = v376309[n]; \\ Antti Karttunen, Jan 18 2025
Extensions
More terms from Antti Karttunen, Jan 18 2025