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.

A127644 a(1)=3. a(n) is the smallest positive integer not occurring earlier in the sequence such that (sum{k=1 to n} a(k)) divides product{j=1 to n} a(j).

This page as a plain text file.
%I A127644 #19 Dec 29 2023 10:58:54
%S A127644 3,6,9,18,12,16,8,24,32,34,30,48,15,1,14,2,17,11,20,4,26,7,21,22,5,27,
%T A127644 10,13,25,40,19,28,33,37,23,42,38,44,35,31,41,29,46,49,39,50,36,43,47,
%U A127644 45,51,54,55,53,52,56,57,62,61,60,64,68,67,58,63,70,69,71,65,77,66,72
%N A127644 a(1)=3. a(n) is the smallest positive integer not occurring earlier in the sequence such that (sum{k=1 to n} a(k)) divides product{j=1 to n} a(j).
%C A127644 Is this a permutation of the positive integers? According to Hans Havermann, this sequence matches sequence A127562 beginning with the 104th term of each. Unlike sequence A127562, the sum of the first n terms of this sequence divides the product of the first n terms for every positive integer n.
%p A127644 N:= 1000: # to get a(1) to a(m-1) where a(m) is the first term > N
%p A127644 a[1]:= 3:
%p A127644 R:= {$1..N} minus {3}:
%p A127644 P:= 3:
%p A127644 S:= 3:
%p A127644 success:= true:
%p A127644 for n from 2 while success and R <> {} do
%p A127644    success := false;
%p A127644    for r in R do
%p A127644      if type((P*r)/(S+r),integer) then
%p A127644         a[n]:= r;
%p A127644         nmax:= n;
%p A127644         R:= R minus {r};
%p A127644         success:= true;
%p A127644         P:= P * r;
%p A127644         S:= S + r;
%p A127644         break
%p A127644      fi
%p A127644    od:
%p A127644 od:
%p A127644 seq(a[i],i=1..nmax); # _Robert Israel_, Dec 13 2014
%t A127644 f[l_List] := Block[{k = 1, s = Plus @@ l, p = Times @@ l},While[MemberQ[l, k] || Mod[k*p, k + s] > 0, k++ ];Append[l, k]];Nest[f, {3}, 75] (* _Ray Chandler_, Jan 22 2007 *)
%o A127644 (PARI) v=[3];print1(3,", ");n=1;while(n<100,p=prod(i=1,#v,v[i]);if(p*n\(vecsum(v)+n)==p*n/(vecsum(v)+n)&&!vecsearch(vecsort(v),n),v=concat(v,n);print1(n,", ");n=0);n++) \\ _Derek Orr_, Dec 13 2014
%Y A127644 Cf. A127562, A127645, A127646.
%K A127644 nonn
%O A127644 1,1
%A A127644 _Leroy Quet_, Jan 22 2007
%E A127644 Extended by _Ray Chandler_, Jan 22 2007