login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A121561 The number of iterations of "subtract the largest prime less than or equal to the current value" to go from n to the limiting value 0 or 1. 8
0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,9

COMMENTS

Number of steps to go from n to A121559(n).

The sequence has the form of blocks of numbers; see A121562 for the lengths of those blocks.

LINKS

Robert G. Wilson v, Table of n, a(n) for n = 1..100000

EXAMPLE

a(9) = 2 because there are 2 steps in going from 9 to 0 in A121559: 9 mod 7 = 2 and 2 mod 2 = 0.

MATHEMATICA

LrgstPrm[n_] := Block[{k = n}, While[ !PrimeQ@ k, k-- ]; k]; f[n_] := Block[{c = 0, d = n}, While[d > 1, d = d - LrgstPrm@d; c++ ]; c]; Array[f, 105] (* Robert G. Wilson v, Feb 29 2008 *)

CROSSREFS

Cf. A121559, A064722, a(n)=1: A093515, a(n)=2: A093513, a(n)=3: A138026, a(n)=4: A138027.

Sequence in context: A328483 A321856 A175078 * A078772 A088018 A204909

Adjacent sequences:  A121558 A121559 A121560 * A121562 A121563 A121564

KEYWORD

easy,nonn

AUTHOR

Kerry Mitchell, Aug 07 2006

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 15 02:31 EDT 2020. Contains 335762 sequences. (Running on oeis4.)