login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A289052 a(1) = 1; a(n) = a(n-A006530(n-1)) + 1 for n > 1. 1

%I #22 May 09 2021 19:21:18

%S 1,2,2,2,3,2,3,2,4,4,3,2,5,2,3,4,4,2,5,2,5,4,3,2,5,6,3,6,5,2,7,2,8,4,

%T 3,6,5,2,3,4,7,2,7,2,5,8,3,2,9,8,9,4,5,2,5,6,9,4,3,2,7,2,3,10,4,6,7,2,

%U 5,4,11,2,5,2,3,12,5,8,7,2,13,8,3,2,9,6,3,4,9,2,7,8,5,4,3,6,5

%N a(1) = 1; a(n) = a(n-A006530(n-1)) + 1 for n > 1.

%H Indranil Ghosh, <a href="/A289052/b289052.txt">Table of n, a(n) for n = 1..10000</a>

%H Altug Alkan, <a href="/A289052/a289052.png">Alternative scatterplot</a>

%t a[1] = 1; a[n_] := a[n] = 1 + a[n - FactorInteger[n - 1][[-1, 1]]]; Array[a, 97] (* _Michael De Vlieger_, Jun 26 2017 *)

%o (PARI) a006530(n) = if(n>1, vecmax(factor(n)[, 1]), 1);

%o q=vector(100000); q[1]=1; for(n=2, #q, q[n]=q[n-a006530(n-1)]+1); q

%o (Python)

%o from sympy import primefactors

%o l=[0, 1, 2]

%o for n in range(3, 201): l.append(l[n - primefactors(n - 1)[-1]] + 1)

%o print(l[1:]) # _Indranil Ghosh_, Jun 23 2017

%Y Cf. A002024, A006530.

%K nonn

%O 1,2

%A _Altug Alkan_, Jun 23 2017

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 20:33 EDT 2024. Contains 371916 sequences. (Running on oeis4.)