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.

A007300 a(1)=2, a(2)=5; for n >= 3, a(n) is smallest number which is uniquely of the form a(j) + a(k) with 1 <= j < k < n.

This page as a plain text file.
%I A007300 M1328 #46 Feb 16 2025 08:32:31
%S A007300 2,5,7,9,11,12,13,15,19,23,27,29,35,37,41,43,45,49,51,55,61,67,69,71,
%T A007300 79,83,85,87,89,95,99,107,109,119,131,133,135,137,139,141,145,149,153,
%U A007300 155,161,163,167,169,171,175,177,181,187,193,195,197,205,209,211,213,215
%N A007300 a(1)=2, a(2)=5; for n >= 3, a(n) is smallest number which is uniquely of the form a(j) + a(k) with 1 <= j < k < n.
%C A007300 An Ulam-type sequence - see A002858 for many further references, comments, etc.
%C A007300 I have a note saying that this is periodic mod 126. Is that correct? - _N. J. A. Sloane_, Apr 29 2006
%C A007300 Comments from _Joshua Zucker_, May 24 2006: "Concerning the conjecture about periodicity mod 126. Out of the first 300 terms, only the 2 and 12 are even. But if you neglect those first 6 terms, mod 2 they're all odd, mod 9 it goes: 0 4 6 1 7 4 6 8 7 2 4 6 8 5 0 8 1 2 5 7 0 2 4 6 1 5 0 2 8 1 5 7 which appears to repeat indefinitely and mod 7 it goes: 0 2 6 1 3 0 2 6 5 4 6 1 2 6 1 3 5 4 1 2 4 0 5 0 2 4 6 1 5 2 6 1 which also appears to repeat indefinitely.
%C A007300 "So it seems as though neglecting the first few terms, it is indeed periodic mod 126 with period 32. In fact it appears that after the first few terms, a(n+32) = a(n) + 126. But this is only based on the first few hundred terms and is not proved!
%C A007300 "The Mathworld link cites a proof that sequences of this type (2,n) have only two even terms and another proof that sequences with only finitely many even terms must eventually have periodic first differences. So I think the period 32 difference of 126 conjecture may be proved in those references."
%C A007300 Given that the sequence of first differences is periodic with period 32 after the first 6 terms (3,2,2,2,1,1), the repeating digits being p=(2,4,4,4,2,6,2,4,2,2,4,2,4,6,6,2,2,8,4,2,2,2,6,4,8,2,10,12,2,2,2,2), one can calculate the n-th term (n>6) as a(n)=13+floor((n-7)/32)*S(32)+S(n-7 mod 32) where S(k)=sum(p(i),i=1..k): (S(k);k=0..32)=(0, 2, 6, 10, 14, 16, 22, 24, 28, 30, 32, 36, 38, 42, 48, 54, 56, 58, 66, 70, 72, 74, 76, 82, 86, 94, 96, 106, 118, 120, 122, 124, 126). - _M. F. Hasler_, Nov 25 2007
%D A007300 R. K. Guy, Unsolved Problems in Number Theory, Section C4.
%D A007300 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A007300 T. D. Noe, <a href="/A007300/b007300.txt">Table of n, a(n) for n = 1..1000</a>
%H A007300 J. Cassaigne and S. R. Finch, <a href="http://www.emis.de/journals/EM/expmath/volumes/4/4.html">A class of 1-additive sequences and additive recurrences</a>, Experimental Mathematics, Volume 4 (1995).
%H A007300 S. R. Finch, <a href="https://www.emis.de/journals/EM/expmath/volumes/1/1.html">Patterns in 1-additive sequences</a>, Experimental Mathematics 1 (1992), 57-63.
%H A007300 S. R. Finch, <a href="https://doi.org/10.1016/0097-3165(92)90042-S">On the regularity of certain 1-additive sequences</a>, J. Combin. Theory, A60 (1992), 123-130.
%H A007300 Steven R. Finch, <a href="http://dx.doi.org/10.2307/2325001">Are 0-Additive Sequences Always Regular?</a>, Am. Math. Monthly 99 (7) (1992) 671-673.
%H A007300 S. Finch, <a href="/A007300/a007300_1.pdf">Letter to N. J. A. Sloane, Apr. 1994</a>
%H A007300 R. K. Guy, <a href="/A007300/a007300.pdf">s-Additive sequences</a>, Preprint, 1994. (Annotated scanned copy)
%H A007300 Project Euler, <a href="https://projecteuler.net/problem=167">Problem 167: Investigating Ulam Sequences</a>.
%H A007300 R. Queneau, <a href="http://dx.doi.org/10.1016/0097-3165(72)90083-0">Sur les suites s-additives</a>, J. Combin. Theory, A12 (1972), 31-71.
%H A007300 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/UlamSequence.html">Ulam Sequence</a>
%H A007300 Wikipedia, <a href="http://en.wikipedia.org/wiki/Ulam_number">Ulam number</a>
%H A007300 <a href="/index/U#Ulam_num">Index entries for Ulam numbers</a>
%H A007300 <a href="/index/Rec#order_33">Index entries for linear recurrences with constant coefficients</a>, signature (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1).
%F A007300 For n > 6, a(n+32) = a(n) + 126. - _T. D. Noe_, Jan 21 2008
%p A007300 A007300:=n->if n<7 then [2, 5, 7, 9, 11, 12][n] else floor((n-7)/32)*126+[13, 15, 19, 23, 27, 29, 35, 37, 41, 43, 45, 49, 51, 55, 61, 67, 69, 71, 79, 83, 85, 87, 89, 95, 99, 107, 109, 119, 131, 133, 135, 137][modp(n-7,32)+1] fi; # _M. F. Hasler_, Nov 25 2007
%t A007300 theList = {2,5}; Print[2]; Print[5]; For[i=1,i <= 500,i++, count=0; For[j=1,j <= Length[theList]-1,j++, For[k=j+1,k <= Length[theList],k++, If[theList[[j]]+theList[[k]] == i,count++ ]; ]; ]; If[count == 1, Print[i]; theList = Append[theList,i]; ]; ]; (* Sam Handler (sam_5_5_5_0(AT)yahoo.com), Aug 08 2006 *)
%t A007300 Nest[Append[#, SelectFirst[Union@ Select[Tally@ Map[Total, Select[Permutations[#, {2}], #1 < #2 & @@ # &]], Last@ # == 1 &][[All, 1]], Function[k, FreeQ[#, k]]]] &, {2, 5}, 59] (* _Michael De Vlieger_, Nov 16 2017 *)
%o A007300 (Haskell)
%o A007300 a007300 n = a007300_list !! (n-1)
%o A007300 a007300_list = 2 : 5 : ulam 2 5 a007300_list
%o A007300 -- Function ulam as defined in A002858.
%o A007300 -- _Reinhard Zumkeller_, Nov 03 2011
%Y A007300 Cf. A100729, A003666, A003667, A006844.
%Y A007300 Cf. A003664.
%K A007300 nonn,easy
%O A007300 1,1
%A A007300 _N. J. A. Sloane_, _Mira Bernstein_
%E A007300 More terms from _Joshua Zucker_, May 24 2006
%E A007300 More terms from Sam Handler (sam_5_5_5_0(AT)yahoo.com), Aug 08 2006