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.

Showing 1-10 of 21 results. Next

A249031 The non-anti-Fibonacci numbers: numbers not in A075326.

Original entry on oeis.org

1, 2, 4, 5, 6, 7, 8, 10, 11, 12, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 28, 30, 31, 32, 34, 35, 36, 37, 38, 40, 41, 42, 44, 45, 46, 47, 48, 50, 51, 52, 54, 55, 56, 57, 59, 60, 61, 62, 64, 65, 66, 67, 68, 70, 71, 72, 74, 75, 76, 77, 79, 80, 81, 82, 84, 85, 86, 87, 88, 90, 91, 92, 94, 95, 96, 97, 99, 100
Offset: 1

Views

Author

N. J. A. Sloane, Oct 26 2014

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List ((\\))
    a249031 n = a249031_list !! (n-1)
    a249031_list = f [1..] where
       f ws@(u:v:_) = u : v : f (ws \\ [u, v, u + v])
    -- Reinhard Zumkeller, Oct 26 2014
    
  • Python
    def A249031(n): return n+(n+1-(m:=n-3&7)>>2)+int(m>=4 and (m!=4 or (~((k:=n-3>>3)+1)&k).bit_length()&1)) # Chai Wah Wu, Sep 11 2024

A249032 First differences of A075326.

Original entry on oeis.org

3, 6, 4, 5, 5, 6, 4, 6, 4, 6, 4, 5, 5, 6, 4, 5, 5, 6, 4, 5, 5, 6, 4, 6, 4, 6, 4, 5, 5, 6, 4, 6, 4, 6, 4, 5, 5, 6, 4, 6, 4, 6, 4, 5, 5, 6, 4, 5, 5, 6, 4, 5, 5, 6, 4, 6, 4, 6, 4, 5, 5, 6, 4, 5, 5, 6, 4, 5, 5, 6, 4, 6, 4, 6, 4, 5, 5, 6, 4, 5, 5, 6, 4, 5, 5, 6
Offset: 0

Views

Author

N. J. A. Sloane, Oct 26 2014

Keywords

Comments

Can be constructed as follows. Apart from the initial "3", one always has either "6-4" (i.e., a 6 followed by a 4), or else "5-5". The 6-4's always come either alone (6-4) or triply (6-4, 6-4, 6-4), while the 5-5's always come alone. So if we let "6-4, 5-5" be represented by the numeral "1", and "6-4, 6-4, 6-4, 5-5" by the numeral "3", then the sequence of first differences, in this compressed code, is A080426, which itself is defined by a simple substitution rule. - D. R. Hofstadter, Oct 23 2014

Crossrefs

Programs

  • Haskell
    a249032 n = a249032_list !! n
    a249032_list = zipWith (-) (tail a075326_list) a075326_list
    -- Reinhard Zumkeller, Oct 26 2014
    
  • Python
    def A249032(n): return 4+int((n+1|(~((m:=n>>1)+1)&m).bit_length())&1^1)+int((n|(~((k:=n-1>>1)+1)&k).bit_length())&1) if n else 3 # Chai Wah Wu, Sep 11 2024

A005228 Sequence and first differences (A030124) together list all positive numbers exactly once.

Original entry on oeis.org

1, 3, 7, 12, 18, 26, 35, 45, 56, 69, 83, 98, 114, 131, 150, 170, 191, 213, 236, 260, 285, 312, 340, 369, 399, 430, 462, 495, 529, 565, 602, 640, 679, 719, 760, 802, 845, 889, 935, 982, 1030, 1079, 1129, 1180, 1232, 1285, 1339, 1394, 1451, 1509, 1568, 1628, 1689
Offset: 1

Views

Author

Keywords

Comments

This is the lexicographically earliest sequence that together with its first differences (A030124) contains every positive integer exactly once.
Hofstadter introduces this sequence in his discussion of Scott Kim's "FIGURE-FIGURE" drawing. - N. J. A. Sloane, May 25 2013
A225850(a(n)) = 2*n-1, cf. A167151. - Reinhard Zumkeller, May 17 2013
In view of the definition of A075326: start with a(0) = 0, and extend by rule that the next term is the sum of the predecessor and the most recent non-member of the sequence. - Reinhard Zumkeller, Oct 26 2014

Examples

			Sequence reads 1 3 7 12 18 26 35 45..., differences are 2 4 5, 6, 8, 9, 10 ... and the point is that every number not in the sequence itself appears among the differences. This property (together with the fact that both the sequence and the sequence of first differences are increasing) defines the sequence!
		

References

  • E. Angelini, "Jeux de suites", in Dossier Pour La Science, pp. 32-35, Volume 59 (Jeux math'), April/June 2008, Paris.
  • D. R. Hofstadter, Goedel, Escher, Bach: an Eternal Golden Braid, Random House, 1980, p. 73.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A030124 (complement), A037257, A056731, A056738, A140778, A225687.
Cf. A225850, A232746, A232747 (inverse), A232739, A232740, A232750 and also permutation pair A232751/A232752 constructed from this sequence and its complement.
Cf. A001651 (analog with sums instead of differences), A121229 (analog with products).
The same recurrence a(n) = a(n-1) + c(n-1) with different starting conditions: A061577 (starting with 2), A022935 (3), A022936 (4), A022937 (5), A022938 (6).
Related recurrences:
a(n-1) + c(n+1) - A022953, A022954.
a(n-1) + c(n) - A022946 to A022952.
a(n-1) + c(n-2) - A022940, A022941.
a(n-2) + c(n-1) - A022942 to A022944.
a(n-2) + c(n-2) - A022939.
a(n-3) + c(n-3) - A022955.
a(n-4) + c(n-4) - A022956.
a(n-5) + c(n-5) - A022957.

Programs

  • Haskell
    a005228 = scanl (+) 1 a030124
    a030124 = go 1 a005228 where go x ys | x < head ys = x     : go (x + 1) ys
                                         | otherwise   = x + 1 : go (x + 2) (tail ys)
    -- Maks Verver, Jun 30 2025
    
  • Maple
    maxn := 5000; h := array(1..5000); h[1] := 1; a := [1]; i := 1; b := []; for n from 2 to 1000 do if h[n] <> 1 then b := [op(b), n]; j := a[i]+n; if j < maxn then a := [op(a),j]; h[j] := 1; i := i+1; fi; fi; od: a; b; # a is A005228, b is A030124.
    A030124 := proc(n)
        option remember;
        local a,fnd,t ;
        if n <= 1 then
            op(n+1,[2,4]) ;
        else
            for a from procname(n-1)+1 do
                fnd := false;
                for t from 1 to n+1 do
                    if A005228(t)  = a then
                        fnd := true;
                        break;
                    end if;
                end do:
                if not fnd then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    A005228 := proc(n)
        option remember;
        if n <= 2 then
            op(n,[1,3]) ;
        else
            procname(n-1)+A030124(n-2) ;
        end if;
    end proc: # R. J. Mathar, May 19 2013
  • Mathematica
    a = {1}; d = 2; k = 1; Do[ While[ Position[a, d] != {}, d++ ]; k = k + d; d++; a = Append[a, k], {n, 1, 55} ]; a
    (* Second program: *)
    (* Program from Larry Morris, Jan 19 2017: *)
    d = 3; a = {1, 3, 7, 12, 18}; While[ Length[a = Join[a, a[[-1]] + Accumulate[Range[a[[d]] + 1, a[[++d]] - 1]]]] < 50]; a
    (* Comment: This adds as many terms to the sequence as there are numbers in each set of sequential differences. Consequently, the list of numbers it produces may be longer than the limit provided. With the limit of 50 shown, the sequence produced has length 60. *)
  • PARI
    A005228(n,print_all=0,s=1,used=0)={while(n--,used += 1<M. F. Hasler, Feb 05 2013

Formula

a(n) = a(n-1) + c(n-1) for n >= 2, where a(1)=1, a( ) increasing, c( ) = complement of a( ) (c is the sequence A030124).
Let a(n) = this sequence, b(n) = A030124 prefixed by 0. Then b(n) = mex{ a(i), b(i) : 0 <= i < n}, a(n) = a(n-1) + b(n) + 1. (Fraenkel)
a(1) = 1, a(2) = 3; a( ) increasing; for n >= 3, if a(q) = a(n-1)-a(n-2)+1 for some q < n then a(n) = a(n-1) + (a(n-1)-a(n-2)+2), otherwise a(n) = a(n-1) + (a(n-1)-a(n-2)+1). - Albert Neumueller (albert.neu(AT)gmail.com), Jul 29 2006
a(n) = n^2/2 + n^(3/2)/(3*sqrt(2)) + O(n^(5/4)) [proved in Jubin link]. - Benoit Jubin, May 13 2015
For all n >= 1, A232746(a(n)) = n and A232747(a(n)) = n. [Both sequences work as left inverses of this sequence.] - Antti Karttunen, May 14 2015

Extensions

Additional comments from Robert G. Wilson v, Oct 24 2001
Incorrect formula removed by Benoit Jubin, May 13 2015

A079523 Utterly odd numbers: numbers whose binary representation ends in an odd number of ones.

Original entry on oeis.org

1, 5, 7, 9, 13, 17, 21, 23, 25, 29, 31, 33, 37, 39, 41, 45, 49, 53, 55, 57, 61, 65, 69, 71, 73, 77, 81, 85, 87, 89, 93, 95, 97, 101, 103, 105, 109, 113, 117, 119, 121, 125, 127, 129, 133, 135, 137, 141, 145, 149, 151, 153, 157, 159, 161, 165, 167, 169, 173, 177, 181
Offset: 1

Views

Author

Benoit Cloitre, Jan 21 2003

Keywords

Comments

Also, n such that A010060(n) = A010060(n+1) where A010060 is the Thue-Morse sequence.
Sequence of n such that a(n) = 3n begins 7, 23, 27, 29, 31, 39, 71, 87, 91, 93, 95, ...
Values of k such that the Motzkin number A001006(2k) is even. Values of k such that the number of restricted hexagonal polyominoes with 2k+1 cells is even (see A002212). Values of k such that the number of directed animals of size k+1 is even (see A005773). Values of k such that the Riordan number A005043(k) is even. - Emeric Deutsch and Bruce E. Sagan, Apr 02 2003
a(n) = A036554(n)-1 = A072939(n)-2. - Ralf Stephan, Jun 09 2003
Odious and evil terms alternate. - Vladimir Shevelev, Jun 22 2009
The sequence has the following fractal property: remove terms of the form 4k+1 from the sequence, and the remaining terms are of the form 4k+3: 7, 23, 31, 39, 55, 71, 87, ...; then subtract 3 from each of these terms and divide by 4 and you get the original sequence: 1, 5, 7, 9, 13, ... - Benoit Cloitre, Apr 06 2010
A035263(a(n)) = 0. - Reinhard Zumkeller, Mar 01 2012

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a079523 n = a079523_list !! (n-1)
    a079523_list = elemIndices 0 a035263_list
    -- Reinhard Zumkeller, Mar 01 2012
    
  • Magma
    [n: n in [0..200] | Valuation(n+1, 2) mod 2 eq 0 + 1]; // Vincenzo Librandi, Apr 16 2015
    
  • Mathematica
    Select[ Range[200], MatchQ[ IntegerDigits[#, 2], {b : (1) ..} | {_, 0, b : (1) ..} /; OddQ[ Length[{b}]]] & ] (* Jean-François Alcover, Jun 17 2013 *)
  • PARI
    is(n)=valuation(n+1,2)%2 \\ Charles R Greathouse IV, Mar 07 2013
    
  • Python
    from itertools import count, islice
    def A079523_gen(startvalue=1): return filter(lambda n:(~(n+1)&n).bit_length()&1,count(max(startvalue,1))) # generator of terms >= startvalue
    A079523_list = list(islice(A079523_gen(),61)) # Chai Wah Wu, Jul 05 2022
    
  • Python
    def A079523(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x):
            c, s = n+x, bin(x)[2:]
            l = len(s)
            for i in range(l&1,l,2):
                c -= int(s[i])+int('0'+s[:i],2)
            return c
        return bisection(f,n,n)-1 # Chai Wah Wu, Jan 29 2025

Formula

a(n) is asymptotic to 3n.
a(n) = 2*A003159(n) - 1. a(1)=1, a(n) = a(n-1) + 2 if (a(n-1)+1)/2 does not belong to the sequence and a(n) = a(n-1) + 4 otherwise. - Emeric Deutsch and Bruce E. Sagan, Apr 02 2003
a(n) = (1/2)*A081706(2n-1).
a(n) = A003158(n) - n = A003157(n) - n - 1. - Philippe Deléham, Feb 22 2004
Values of k such that A091297(k) = 0. - Philippe Deléham, Feb 25 2004

A131323 Odd numbers whose binary expansion ends in an even number of 1's.

Original entry on oeis.org

3, 11, 15, 19, 27, 35, 43, 47, 51, 59, 63, 67, 75, 79, 83, 91, 99, 107, 111, 115, 123, 131, 139, 143, 147, 155, 163, 171, 175, 179, 187, 191, 195, 203, 207, 211, 219, 227, 235, 239, 243, 251, 255, 259, 267, 271, 275, 283, 291, 299, 303, 307, 315, 319, 323, 331
Offset: 1

Views

Author

Nadia Heninger and N. J. A. Sloane, Dec 16 2007

Keywords

Comments

Also numbers of the form (4^a)*b - 1 with positive integer a and odd integer b. The sequence has linear growth and the limit of a(n)/n is 6. - Stefan Steinerberger, Dec 18 2007
Evil and odious terms alternate. - Vladimir Shevelev, Jun 22 2009
Also odd numbers of the form m = (A079523(k)-1)/2. - Vladimir Shevelev, Jul 06 2009
As a set, this is the complement of A079523 in the odd numbers. - Michel Dekking, Feb 13 2019
From Ctibor O. Zizka, Dec 28 2024: (Start)
Numbers k >= 1 such that (k + 1)*(k + 2*r)/2 is not a square for any r >= 1.
Numbers k such that A076114(k + 1) = 0. (End)

Examples

			11 in binary is 1011, which ends with two 1's.
		

Crossrefs

Programs

  • Maple
    N:= 1000: # to get all terms up to N
    Odds:= [seq(2*i+1,i=0..floor((N-1)/2)]:
    f:= proc(n) local L,x;
       L:= convert(n,base,2);
       x:= ListTools:-Search(0,L);
       if x = 0 then type(nops(L),even) else type(x,odd) fi
    end proc:
    A131323:= select(f,Odds); # Robert Israel, Apr 02 2014
  • Mathematica
    Select[Range[500], OddQ[ # ] && EvenQ[FactorInteger[ # + 1][[1, 2]]] &] (* Stefan Steinerberger, Dec 18 2007 *)
    en1Q[n_]:=Module[{ll=Last[Split[IntegerDigits[n,2]]]},Union[ll] =={1} &&EvenQ[Length[ll]]]; Select[Range[1,501,2],en1Q] (* Harvey P. Dale, May 18 2011 *)
  • PARI
    is(n)=n%2 && valuation(n+1,2)%2==0 \\ Charles R Greathouse IV, Aug 20 2013
    
  • Python
    from itertools import count, islice
    def A131323_gen(startvalue=3): # generator of terms >= startvalue
        return map(lambda n:(n<<1)+1,filter(lambda n:(~(n+1)&n).bit_length()&1,count(max(startvalue>>1,1))))
    A131323_list = list(islice(A131323_gen(),30)) # Chai Wah Wu, Sep 11 2024
    
  • Python
    def A131323(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x):
            c, s = n+x, bin(x+1)[2:]
            l = len(s)
            for i in range(l&1,l,2):
                c -= int(s[i])+int('0'+s[:i],2)
            return c
        return bisection(f,n,n)<<1|1 # Chai Wah Wu, Jan 29 2025

Formula

a(n) = 2*A079523(n) + 1. - Michel Dekking, Feb 13 2019

Extensions

More terms from Stefan Steinerberger, Dec 18 2007

A265389 The sums from the following procedure: from the list of positive integers, repeatedly remove the first three numbers and their sum.

Original entry on oeis.org

6, 16, 27, 36, 46, 57, 66, 75, 87, 96, 106, 117, 126, 136, 147, 156, 165, 177, 186, 196, 207, 216, 227, 237, 246, 255, 267, 276, 286, 297, 306, 316, 327, 336, 345, 357, 366, 376, 387, 396, 406, 417, 426, 435, 447, 456, 466, 477, 486, 497, 507, 516, 525, 537
Offset: 1

Views

Author

Peter Kagey, Dec 08 2015

Keywords

Comments

This sequence is a solution, along with three other sequences, of a system of four complementary equations; see A297464. It is the "anti-tribonacci" sequence, in analogy with the anti-Fibonacci sequence, A075326. - Clark Kimberling, Apr 22 2018

Programs

  • Maple
    S:= {$1..1000}: A:= NULL:
    while nops(S) >= 3 do
      T:= S[1..3];
      s:= convert(T,`+`);
      S:= S[4..-1] minus {s};
      A:= A, s
    od:
    A; # Robert Israel, Dec 22 2015
  • Mathematica
    f[n_] := Block[{a = {}, r = Range@ n, s}, Do[If[Length@ r > 4, s = Total@ Take[r, 3 ]; AppendTo[a, s]; r = Drop[#, 3] &@ DeleteCases[r, x_ /; x == s], Break[]], {k, n}]; a]; f@ 184 (* Michael De Vlieger, Dec 22 2015 *)
    morph = Nest[Flatten[# /. {0 -> {1, 2, 0}, 1 -> {1, 1, 0}, 2 -> {1, 0, 0}}] &, {0}, 9]; A265389 = Accumulate[Prepend[Drop[Flatten[morph /. Thread[{0, 1, 2} -> {{1, 1, 4}, {1, 2, 3}, {1, 3, 2}}]], 1] + 8, 6]];
    Take[A265389, 100]    (* Peter J. C. Moses, May 03 2018 *)
  • Ruby
    x = (1..10000).to_a
    (0...1000).collect do
      y = x.shift(3).reduce(:+); x.delete_at x.index(y); y
    end

A080426 a(1)=1, a(2)=3; all terms are either 1 or 3; each run of 3's is followed by a run of two 1's; and a(n) is the length of the n-th run of 3's.

Original entry on oeis.org

1, 3, 1, 1, 3, 3, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 3, 3, 1, 1, 3, 3, 3, 1, 1, 3, 3, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 3, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 3, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 3, 3, 1, 1, 3, 3, 3, 1, 1, 3, 3, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 3, 3, 1, 1, 3, 3, 3, 1, 1, 3, 3, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 3, 3, 1, 1
Offset: 1

Views

Author

John W. Layman, Feb 18 2003

Keywords

Comments

It appears that the sequence can be calculated by any of the following three methods: (1) Start with 1 and repeatedly replace (simultaneously) all 1's with 1,3,1 and all 3's with 1,3,3,3,1. [Equivalently, trajectory of 1 under the morphism 1 -> 1,3,1; 3 -> 1,3,3,3,1. - N. J. A. Sloane, Nov 03 2019] (2) a(n)= A026490(2n). (3) Replace each 2 in A026465 (run lengths in Thue-Morse) with 3.
Length of n-th run of 1's in the Feigenbaum sequence A035263 = 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, .... - Philippe Deléham, Apr 18 2004
Another construction. Let S_0 = 1, and let S_n be obtained by applying the morphism 1 -> 3, 3 -> 113 to S_{n-1}. The sequence is the concatenation S_0, S_1, S_2, ... - D. R. Hofstadter, Oct 23 2014
a(n+1) is the number of times n appears in A003160. - John Keith, Dec 31 2020

Crossrefs

Arises in the analysis of A075326, A249031 and A249032.

Programs

  • Haskell
    -- following Deléham
    import Data.List (group)
    a080426 n = a080426_list !! n
    a080426_list = map length $ filter ((== 1) . head) $ group a035263_list
    -- Reinhard Zumkeller, Oct 27 2014
    
  • Mathematica
    Position[ Nest[ Flatten[# /. {0 -> {0, 2, 1}, 1 -> {0}, 2 -> {0}}]&, {0}, 8], 0] // Flatten // Differences // Prepend[#, 1]& (* Jean-François Alcover, Mar 14 2014, after Philippe Deléham *)
    nsteps=7;Flatten[SubstitutionSystem[{1->{3},3->{1,1,3}},{1},nsteps]] (* Paolo Xausa, Aug 12 2022, using D. R. Hofstadter's construction *)
  • PARI
    A080426(nmax) = my(a=[1], s=[[1, 3, 1], [], [1, 3, 3, 3, 1]]); while(length(a)A080426(100) \\ Paolo Xausa, Sep 14 2022, using method (1) from comments
    
  • Python
    def A080426(nmax):
        a, s = "1", "".maketrans({"1":"131", "3":"13331"})
        while len(a) < nmax: a = a.translate(s)
        return list(map(int, a[:nmax]))
    print(A080426(100)) # Paolo Xausa, Aug 30 2022, using method (1) from comments
    
  • Python
    def A080426(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x):
            c, s = x, bin(x)[2:]
            l = len(s)
            for i in range(l&1,l,2):
                c -= int(s[i])+int('0'+s[:i],2)
            return c
        return bisection(lambda x:f(x)+n,n,n)-bisection(lambda x:f(x)+n-1,n-1,n-1)-1 # Chai Wah Wu, Jan 29 2025

Formula

a(1) = 1; for n>1, a(n) = A003156(n) - A003156(n-1). - Philippe Deléham, Apr 16 2004

A101544 Smallest permutation of the natural numbers with a(3*k-2) + a(3*k-1) = a(3*k), k > 0.

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 6, 7, 13, 8, 10, 18, 11, 12, 23, 14, 15, 29, 16, 17, 33, 19, 20, 39, 21, 22, 43, 24, 25, 49, 26, 27, 53, 28, 30, 58, 31, 32, 63, 34, 35, 69, 36, 37, 73, 38, 40, 78, 41, 42, 83, 44, 45, 89, 46, 47, 93, 48, 50, 98, 51, 52, 103, 54, 55, 109, 56, 57, 113, 59, 60
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 06 2004

Keywords

Comments

Inverse: A101545; A101546(n) = a(a(n)).
From Bernard Schott, Jun 30 2019: (Start)
The terms can also be written simply following this array with 3 columns:
1st column 2nd column 3rd column
1 + 2 = 3
4 + 5 = 9
6 + 7 = 13
8 + 10 = 18
11 + 12 = 23
14 + 15 = 29
16 + 17 = 33
... ... ...
Question: in which column ends up the repdigit R_m(d) with m times the digit d?
Answer: R_m(d) will be in:
1) column 1 if d = 1, 4, 6, 8, or if d = 9 and m is even;
2) column 2 if d = 2, 5, 7;
3) column 3 if d = 3, or if d = 9 and m is odd.
Problem coming from Krusemeyer et al. (End)

Crossrefs

Programs

  • Maple
    N:= 100: # to get a(1) .. a(N)
    S:= {$1..N}:
    for n from 1 to N do
      if n mod 3 = 0 then A[n] := A[n-1]+A[n-2]
      else A[n]:= min(S)
      fi;
      S:= S minus {A[n]};
    od:
    seq(A[i],i=1..N); # Robert Israel, Feb 07 2016
  • Mathematica
    Fold[Append[#1, If[Divisible[#2, 3], #1[[-1]] + #1[[-2]], Min@Complement[Range[Max@#1 + 1], #1]]] &, {1}, Range[2, 71]] (* Ivan Neretin, Feb 05 2016 *)
  • PARI
    A101544_upto(N, U=[], T=0)=vector(N, n, if(n%=3, while(if(U, U[1])==T+=1, U=U[^1]); n>1 || N=T; T, U=concat(U, N+=T); N))
    apply( {A101544(n, k=(n-=1)\12, m=n\3%4, c=n%3)=(10*k+3*m-(m>1))<<(c>1)+c+(m<3 || c==1 || valuation(k+1,2)%2)}, [1..99]) \\ M. F. Hasler, Nov 26 2024

Formula

From Rémy Sigrist, Apr 05 2020: (Start)
- a(3*n-2) = A249031(2*n-1),
- a(3*n-1) = A249031(2*n),
- a(3*n) = A075326(n).
(End)
a(3*(4k + m) + c) = (10k + 3m - [m>1])*2^[c=3] + c - [m = 3 and c <> 2 and k+1 is in A036554], where 1 <= c <= 3, 0 <= m <= 3, and [.] is the Iverson bracket. - M. F. Hasler, Nov 26 2024

A249406 Start with a(1) = 1, and extend by the rule that the next term is the product of the two most recent non-terms of the sequence.

Original entry on oeis.org

1, 6, 20, 56, 90, 132, 182, 240, 306, 399, 506, 600, 702, 812, 930, 1056, 1190, 1332, 1482, 1640, 1806, 1980, 2162, 2352, 2550, 2756, 2970, 3306, 3540, 3782, 4032, 4290, 4556, 4830, 5112, 5402, 5700, 6006, 6320, 6642, 6972, 7310, 7656, 8099, 8556, 8930, 9312
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 31 2014

Keywords

Comments

Compare to A075326, where not products, but sums of the two most recent non-terms are considered;
a(195) = 159200 is the smallest even term not of the form m*(m+1); see also A249408, the set of all non-oblong terms of this sequence.
a(10) = 399 is the smallest odd term.

Crossrefs

Cf. A000301, A000304, A075326, A249055, A249407 (complement), subsequence of A002808.

Programs

  • Haskell
    import Data.List ((\\))
    a249406 n = a249406_list !! (n-1)
    a249406_list = 1 : f [2..] where
       f ws@(u:v:_) = y : f (ws \\ [u, v, y]) where y = u * v

A299405 Solution (a(n)) of the system of 5 complementary equations in Comments.

Original entry on oeis.org

1, 5, 9, 14, 18, 22, 27, 31, 35, 39, 43, 48, 52, 56, 60, 65, 69, 73, 77, 82, 86, 90, 95, 99, 103, 107, 111, 116, 120, 124, 128, 133, 137, 141, 145, 150, 154, 158, 163, 167, 171, 175, 179, 184, 188, 192, 196, 201, 205, 209, 213, 218, 222, 226, 231, 235, 239
Offset: 0

Views

Author

Clark Kimberling, Apr 22 2018

Keywords

Comments

Define sequences a(n), b(n), c(n), d(n) recursively, starting with a(0) = 1, b(0) = 2, c(0) = 3;:
a(n) = least new;
b(n) = least new;
c(n) = least new;
d(n) = least new;
e(n) = a(n) + b(n) + c(n) + d(n);
where "least new k" means the least positive integer not yet placed.
***
Conjecture: for all n >= 0,
0 <= 17n - 11 - 4 a(n) <= 4
0 <= 17n - 7 - 4 b(n) <= 4
0 <= 17n - 3 - 4 c(n) <= 3
0 <= 17n + 1 - 4 d(n) <= 3
0 <= 17n - 5 - e(n) <= 3
***
The sequences a,b,c,d,e partition the positive integers. The sequence e can be called the "anti-tetranacci sequence"; see A075326 (anti-Fibonacci numbers) and A265389 (anti-tribonacci numbers).

Examples

			n:   0  1   2    3   4   5   6   7   8   9
a:   1  5   9   14  18  22  27  31  35  39
b:   2  6   11  15  19  23  28  32  36  40
c:   3  7   12  16  20  24  29  33  37  41
d:   4  8   13  17  21  25  30  34  38  42
e:  10  26  45  62  78  94 114 130 146 162
		

Crossrefs

Programs

  • Mathematica
    z = 200;
    mex[list_, start_] := (NestWhile[# + 1 &, start, MemberQ[list, #] &]);
    a = {1}; b = {2}; c = {3}; d = {4}; e = {}; AppendTo[e,
    Last[a] + Last[b] + Last[c] + Last[d]];
    Do[{AppendTo[a, mex[Flatten[{a, b, c, d, e}], 1]],
       AppendTo[b, mex[Flatten[{a, b, c, d, e}], 1]],
       AppendTo[c, mex[Flatten[{a, b, c, d, e}], 1]],
       AppendTo[d, mex[Flatten[{a, b, c, d, e}], 1]],
       AppendTo[e, Last[a] + Last[b] + Last[c] + Last[d]]}, {z}];
    Take[a, 100]  (* A299405 *)
    Take[b, 100]  (* A299637 *)
    Take[c, 100]  (* A299638 *)
    Take[d, 100]  (* A299641 *)
    Take[e, 100]  (* A299409 *)
Showing 1-10 of 21 results. Next