cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A132275 a(1)=1. a(n+1) = sum{k=1 to n} (a(k)th integer from among those positive integers which are coprime to a(n+1-k)).

This page as a plain text file.
%I A132275 #26 Mar 14 2018 04:26:05
%S A132275 1,1,2,4,8,17,37,81,177,387,847,1856,4066,8910,19524,42783,93760,
%T A132275 205475,450282,986770,2162473,4738974,10385267,22758885,49875175,
%U A132275 109299427,239525260,524909877,1150318695,2520876742,5524399079,12106496388,26530895539,58141380910
%N A132275 a(1)=1. a(n+1) = sum{k=1 to n} (a(k)th integer from among those positive integers which are coprime to a(n+1-k)).
%e A132275 To compute a(5) we add the first integer coprime to a(4), the first integer coprime to a(3), the 2nd integer coprime to a(2) and the 4th integer coprime to a(1), which is the first integer in {1,3,4,5,..}, the first integer in {1,2,3,4,...}, the 2nd integer in {1,2,3,4,...} and the 4th integer in {1,2,3,4,..} = 1+1+2+4=8.
%p A132275 A132275 := proc(n) option remember; local a,k,an1k,kcoud,c ; if n = 1 then 1; else a :=0 ; for k from 1 to n-1 do an1k := procname(n-k) ; kcoud := 0 ; for c from 1 do if gcd(c,an1k) = 1 then kcoud := kcoud+1 ; fi; if kcoud = procname(k) then a := a+c ; break; fi; od: od: a; fi; end:
%p A132275 seq(A132275(n),n=1..18) ; # _R. J. Mathar_, Jul 20 2009
%p A132275 with(numtheory): fc:= proc(t,p) option remember; local m, j, h, pp; if p=1 then t else pp:= phi(p); m:= iquo(t,pp); j:= m*pp; h:= m*p-1; while j<t do h:= h+1; if igcd(p,h)=1 then j:= j+1 fi od; h fi end: a:= proc(n) option remember; `if`(n=1, 1, add(fc(a(k), a(n-k)), k=1..n-1)) end: seq(a(n), n=1..35); # _Alois P. Heinz_, Aug 05 2009
%t A132275 fc[t_, p_] := fc[t, p] = Module[{m, j, h, pp}, If[p==1, t, pp = EulerPhi[p]; m = Quotient[t, pp]; j = m*pp; h = m*p-1; While[j<t, h++; If [GCD[p, h]==1, j++]]; h]]; a[n_] := a[n] = If[n==1, 1, Sum[fc[a[k], a[n-k]], {k, 1, n-1}]]; Table[a[n], {n, 1, 35}] (* _Jean-François Alcover_, Mar 21 2017, after _Alois P. Heinz_ *)
%Y A132275 Cf. A126572, A132273, A132274.
%K A132275 nonn
%O A132275 1,3
%A A132275 _Leroy Quet_, Aug 16 2007
%E A132275 Corrected from a(5) on by _R. J. Mathar_, Jul 21 2009
%E A132275 Extended beyond a(19) _Alois P. Heinz_, Aug 05 2009