login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A003278 Szekeres's sequence: a(n)-1 in ternary = n-1 in binary; also: a(1) = 1, a(2) = 2, and thereafter a(n) is smallest number k which avoids any 3-term arithmetic progression in a(1), a(2), ..., a(n-1), k.
(Formerly M0975)
70

%I M0975 #152 Aug 13 2022 15:45:17

%S 1,2,4,5,10,11,13,14,28,29,31,32,37,38,40,41,82,83,85,86,91,92,94,95,

%T 109,110,112,113,118,119,121,122,244,245,247,248,253,254,256,257,271,

%U 272,274,275,280,281,283,284,325,326,328,329,334,335,337,338,352,353

%N Szekeres's sequence: a(n)-1 in ternary = n-1 in binary; also: a(1) = 1, a(2) = 2, and thereafter a(n) is smallest number k which avoids any 3-term arithmetic progression in a(1), a(2), ..., a(n-1), k.

%C That is, there are no three elements A, B and C such that B - A = C - B.

%C Positions of 1's in Richard Stanley's Forest Fire sequence A309890. - _N. J. A. Sloane_, Dec 01 2019

%C Subtracting 1 from each term gives A005836 (ternary representation contains no 2's). - _N. J. A. Sloane_, Dec 01 2019

%C Difference sequence related to Gray code bit sequence (A001511). The difference patterns follows a similar repeating pattern (ABACABADABACABAE...), but each new value is the sum of the previous values, rather than simply 1 more than the maximum of the previous values. - Hal Burch (hburch(AT)cs.cmu.edu), Jan 12 2004

%C Sums of distinct powers of 3, translated by 1.

%C Positions of 0 in A189820; complement of A189822. - _Clark Kimberling_, May 26 2011

%C Also, Stanley sequence S(1): see OEIS Index under Stanley sequences (link below). - _M. F. Hasler_, Jan 18 2016

%C Named after the Hungarian-Australian mathematician George Szekeres (1911-2005). - _Amiram Eldar_, May 07 2021

%C If A_n=(a(1),a(2),...,a(2^n)), then A_(n+1)=(A_n,A_n+3^n). - _Arie Bos_, Jul 24 2022

%D Steven R. Finch, Mathematical Constants, Cambridge, 2003, p. 164.

%D Richard K. Guy, Unsolved Problems in Number Theory, E10.

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%H David W. Wilson, <a href="/A003278/b003278.txt">Table of n, a(n) for n = 1..10000</a> [a(1..1024) from T. D. Noe]

%H Jean-Paul Allouche and Jeffrey Shallit, <a href="http://www.cs.uwaterloo.ca/~shallit/Papers/as0.ps">The ring of k-regular sequences</a>, Theoretical Computer Sci., 98 (1992), 163-197.

%H Jean-Paul Allouche and Jeffrey Shallit, <a href="http://dx.doi.org/10.1016/0304-3975(92)90001-V">The ring of k-regular sequences</a>, Theoretical Computer Sci., 98 (1992), 163-197.

%H Paul Erdős and Paul Turan, <a href="https://users.renyi.hu/~p_erdos/1936-05.pdf">On some sequences of integers</a>, J. London Math. Soc., 11 (1936), 261-264.

%H Joseph Gerver, James Propp and Jamie Simpson, <a href="http://dx.doi.org/10.1090/S0002-9939-1988-0929018-1">Greedily partitioning the natural numbers into sets free of arithmetic progressions</a> Proc. Amer. Math. Soc. 102 (1988), no. 3, 765-772.

%H Fanel Iacobescu, <a href="http://www.gallup.unm.edu/~smarandache/SN/ScArt5/SPartitionType.pdf">Smarandache Partition Type and Other Sequences</a>, Bull. Pure Appl. Sci. 16E, 237-240, 1997.

%H Henry Ibstedt, <a href="http://vixra.org/abs/1403.0853">A Few Smarandache Sequences</a>, Smarandache Notions Journal, Vol. 8, No. 1-2-3, 1997, 170-183.

%H Gabor Korvin, <a href="http://arxiv.org/abs/1404.1557">Short note: Every large set of integers contains a three term arithmetic progression</a> arXiv 1404.1557 [math.NT], Apr 6 2014.

%H Leo Moser, <a href="http://www.trillia.com/moser-number.html">An Introduction to the Theory of Numbers</a>, The Trillia Group, 2011 (written in 1957). See pp. 61-62.

%H James Propp and N. J. A. Sloane, <a href="/A006997/a006997.pdf">Email, March 1994</a>

%H Florentin Smarandache, <a href="http://www.gallup.unm.edu/~smarandache/Sequences-book.pdf">Sequences of Numbers Involved in Unsolved Problems</a>.

%H R. P. Stanley, <a href="/A003277/a003277.pdf">Letter to N. J. A. Sloane, c. 1991</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SmarandacheSequences.html">Smarandache Sequences</a>.

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%H <a href="/index/No#non_averaging">Index entries related to non-averaging sequences</a>

%H <a href="/index/St#Stanley">Index entries related to Stanley sequences</a>

%F a(2*k + 2) = a(2*k + 1) + 1, a(2^k + 1) = 2*a(2^k).

%F a(n) = b(n+1) with b(0) = 1, b(2*n) = 3*b(n)-2, b(2*n+1) = 3*b(n)-1. - _Ralf Stephan_, Aug 23 2003

%F G.f.: x/(1-x)^2 + x * Sum_{k>=1} 3^(k-1)*x^(2^k)/((1-x^(2^k))*(1-x)). - _Ralf Stephan_, Sep 10 2003, corrected by _Robert Israel_, May 25 2011

%F Conjecture: a(n) = (A191107(n) + 2)/3 = (A055246(n) + 5)/6. - _L. Edson Jeffery_, Nov 26 2015

%F a(n) mod 2 = A010059(n). - _Arie Bos_, Aug 13 2022

%e G.f. = x + 2*x^2 + 4*x^3 + 5*x^4 + 10*x^5 + 11*x^6 + 13*x^7 + 14*x^8 + 28*x^9 + ...

%p a:= proc(n) local m, r, b; m, r, b:= n-1, 1, 1;

%p while m>0 do r:= r+b*irem(m, 2, 'm'); b:= b*3 od; r

%p end:

%p seq(a(n), n=1..100); # _Alois P. Heinz_, Aug 17 2013

%t Take[ Sort[ Plus @@@ Subsets[ Table[3^n, {n, 0, 6}]]] + 1, 58] (* _Robert G. Wilson v_, Oct 23 2004 *)

%t a[1] = 0; h = 180;

%t Table[a[3 k - 2] = a[k], {k, 1, h}];

%t Table[a[3 k - 1] = a[k], {k, 1, h}];

%t Table[a[3 k] = 1, {k, 1, h}];

%t Table[a[n], {n, 1, h}] (* A189820 *)

%t Flatten[Position[%, 0]] (* A003278 *)

%t Flatten[Position[%%, 1]] (* A189822 *)

%t (* A003278 from A189820, from _Clark Kimberling_, May 26 2011 *)

%t Table[FromDigits[IntegerDigits[n, 2], 3] + 1, {n, 0, 57}] (* _Amit Munje_, Jun 03 2018 *)

%o (Perl) $nxt = 1; @list = (); for ($cnt = 0; $cnt < 1500; $cnt++) { while (exists $legal{$nxt}) { $nxt++; } print "$nxt "; last if ($nxt >= 1000000); for ($i = 0; $i <= $#list; $i++) { $t = 2*$nxt - $list[$i]; $legal{$t} = -1; } $cnt++; push @list, $nxt; $nxt++; } # Hal Burch

%o (PARI) a(n)=1+sum(i=1,n-1,(1+3^valuation(i,2))/2) \\ _Ralf Stephan_, Jan 21 2014

%o (Python)

%o def A003278(n):

%o return int(format(n-1,'b'),3)+1 # _Chai Wah Wu_, Jan 04 2015

%o (Julia)

%o function a(n)

%o return 1 + parse(Int, bitstring(n-1), base=3)

%o end # _Gabriel F. Lipnik_, Apr 16 2021

%Y Equals 1 + A005836. Cf. A001511, A098871.

%Y Row 0 of array in A093682.

%Y Summary of increasing sequences avoiding arithmetic progressions of specified lengths (the second of each pair is obtained by adding 1 to the first):

%Y 3-term AP: A005836 (>=0), A003278 (>0);

%Y 4-term AP: A005839 (>=0), A005837 (>0);

%Y 5-term AP: A020654 (>=0), A020655 (>0);

%Y 6-term AP: A020656 (>=0), A005838 (>0);

%Y 7-term AP: A020657 (>=0), A020658 (>0);

%Y 8-term AP: A020659 (>=0), A020660 (>0);

%Y 9-term AP: A020661 (>=0), A020662 (>0);

%Y 10-term AP: A020663 (>=0), A020664 (>0).

%Y Cf. A003002, A229037 (the Forest Fire sequence), A309890 (Stanley's version).

%Y Similar formula:

%Y If A_n=(a(1),a(2),...,a(2^n)), then A_(n+1)=(A_n,A_n+4^n) produces A098871;

%Y If A_n=(a(1),a(2),...,a(2^n)), then A_(n+1)=(A_n,A_n+2*3^n) produces A191106.

%K nonn,nice,easy

%O 1,2

%A _N. J. A. Sloane_ and _Richard Stanley_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 26 05:54 EDT 2024. Contains 371990 sequences. (Running on oeis4.)