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.

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

This page as a plain text file.
%I A132274 #20 Jan 28 2024 04:47:09
%S A132274 1,1,3,6,10,19,27,41,51,66,78,101,119,145,167,197,219,247,272,306,335,
%T A132274 371,403,443,477,521,559,609,647,693,737,789,834,886,940,996,1055,
%U A132274 1118,1176,1243,1306,1385,1450,1523,1596,1676,1749,1844,1914,2010,2092,2188
%N A132274 a(1)=1; a(n+1) = Sum_{k=1..n} (k-th integer from among those positive integers which are coprime to a(n+1-k)).
%e A132274 The integers coprime to a(1)=1 are 1,2,3,4,5,6,... The 5th of these is 5. The integers coprime to a(2)=1 are 1,2,3,4,5... The 4th of these is 4. The integers coprime to a(3)=3 are 1,2,4,5,7,... The 3rd of these is 4. The integers coprime to a(4)=6 are 1,5,7,11,... The 2nd of these is 5. And the integers coprime to a(5)=10 are 1,3,7,9,11,... The first of these is 1. So a(6) = 5 + 4 + 4 + 5 + 1 = 19.
%p A132274 A132274 := 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 = k then a := a+c ; break; fi; od: od: a; fi; end: seq(A132274(n),n=1..60) ; # _R. J. Mathar_, Jul 20 2009
%t A132274 A132274[n_] := A132274[n] = Module[{a, k, an1k, kcoud, c}, If[n == 1, 1, a = 0; For[k = 1, k <= n-1, k++, an1k = A132274[n-k]; kcoud = 0; For[c = 1, True, c++, If[GCD[c, an1k] == 1, kcoud++]; If[kcoud == k, a = a+c; Break[]]]]; a]];
%t A132274 Table[A132274[n], {n, 1, 60}] (* _Jean-François Alcover_, Jan 28 2024, after _R. J. Mathar_ *)
%Y A132274 Cf. A126572, A132273, A132275.
%K A132274 nonn
%O A132274 1,3
%A A132274 _Leroy Quet_, Aug 16 2007
%E A132274 Extended beyond a(8) by _R. J. Mathar_, Jul 20 2009