login
a(n) = gpf(2*a(n-1)+1), with a(1)=1, where gpf = A006530.
1

%I #25 Feb 03 2025 14:11:55

%S 1,3,7,5,11,23,47,19,13,3,7,5,11,23,47,19,13,3,7,5,11,23,47,19,13,3,7,

%T 5,11,23,47,19,13,3,7,5,11,23,47,19,13,3,7,5,11,23,47,19,13,3,7,5,11,

%U 23,47,19,13,3,7,5,11,23,47,19,13,3,7,5,11,23,47,19,13,3,7,5

%N a(n) = gpf(2*a(n-1)+1), with a(1)=1, where gpf = A006530.

%C Periodic with period length 8.

%D Oskars Rieksts, Email to N. J. A. Sloane, Jun 04 2017.

%H Colin Barker, <a href="/A287865/b287865.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,1).

%F From _Colin Barker_, Jun 04 2017: (Start)

%F G.f.: x*(1 + 3*x + 7*x^2 + 5*x^3 + 11*x^4 + 23*x^5 + 47*x^6 + 19*x^7 + 12*x^8) / ((1 - x)*(1 + x)*(1 + x^2)*(1 + x^4)).

%F a(n) = a(n-8) for n>9. (End)

%p gpf:= n->max(1, op(numtheory[factorset](n))); # A006530

%p a:=[1]; i:=1;

%p for n from 1 to 100 do i:=gpf(2*i+1); a:=[op(a),i]; od:

%p a;

%t LinearRecurrence[PadLeft[{1}, 8], {1, 3, 7, 5, 11, 23, 47, 19, 13}, 100] (* _Paolo Xausa_, Feb 02 2025 *)

%o (Python)

%o from sympy import primefactors

%o l=[0, 1]

%o for n in range(2, 77):

%o l.append(primefactors(2*l[n - 1] + 1)[-1])

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

%o (PARI) Vec(x*(1 + 3*x + 7*x^2 + 5*x^3 + 11*x^4 + 23*x^5 + 47*x^6 + 19*x^7 + 12*x^8) / ((1 - x)*(1 + x)*(1 + x^2)*(1 + x^4)) + O(x^100)) \\ _Colin Barker_, Jun 04 2017

%Y Cf. A006530.

%K nonn,easy,changed

%O 1,2

%A _N. J. A. Sloane_, Jun 04 2017