|
Search: id:A072491
|
|
|
| A072491 |
|
Define f(1) = 0. For n>=2, let f(n) = n - p where p is the largest prime <= n. a(n) = number of iterations of f to reach 0, starting from n. |
|
+0 3
|
|
| 1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 3, 2, 1, 2, 1, 2, 2, 2, 3, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 3, 2, 1, 2, 2, 2, 3, 2, 1, 2, 1, 2, 2, 2, 3, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 3, 2, 1, 2, 2, 2, 1, 2, 2, 2, 3, 2, 1, 2, 2, 2, 3, 2, 3, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2
(list; graph; listen)
|
|
|
OFFSET
|
1,4
|
|
|
COMMENT
|
a(p)=1, a(p+1)=2 and a(p+4)=3 if p is an odd prime but p+2 and p+4 are composite.
|
|
EXAMPLE
|
a(27)=3 as f(27)=27-23=4, f(4)=4-3=1 and f(1)=0.
|
|
MATHEMATICA
|
f[1]=0; f[n_] := n-Prime[PrimePi[n]]; a[n_] := Module[{k, x}, For[k=0; x=n, x>0, k++; x=f[x], Null]; k]
|
|
CROSSREFS
|
Cf. A072492. A066352(n) is the smallest k such that a(k)=n.
This is not the same as A051034: here a(122) = 3, but A051034 has a(122) = 2.
Sequence in context: A052299 A071854 A072410 this_sequence A051034 A082477 A036430
Adjacent sequences: A072488 A072489 A072490 this_sequence A072492 A072493 A072494
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
Amarnath Murthy (amarnath_murthy(AT)yahoo.com), Jul 14 2002
|
|
EXTENSIONS
|
Edited by Dean Hickerson (dean.hickerson(AT)yahoo.com), Nov 26 2002
|
|
|
Search completed in 0.002 seconds
|