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 59 results. Next

A241752 Smallest number m such that A229037(m) = n.

Original entry on oeis.org

1, 3, 95, 8, 22, 121, 144, 24, 27, 60, 67, 73, 66, 79, 163, 196, 148, 150, 220, 80, 181, 173, 178, 197, 213, 203, 194, 202, 261, 374, 304, 387, 645, 295, 447, 379, 290, 420, 362, 506, 515, 878, 520, 836, 941, 495, 594, 754, 884, 958, 501, 485, 561, 407, 467
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 28 2014

Keywords

Comments

A229037(a(n)) = n and A229037(m) <> n for m < a(n).

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a241752 = (+ 1) . fromJust . (`elemIndex` a229037_list)

A236246 Indices n for which A229037(n)=1.

Original entry on oeis.org

1, 2, 4, 5, 10, 11, 13, 14, 28, 29, 31, 32, 37, 38, 40, 41, 82, 83, 85, 86, 92, 93, 96, 105, 111, 112, 115, 116, 122, 177, 236, 237, 244, 245, 247, 266, 267, 270, 276, 277, 283, 294, 301, 302, 347, 558, 628, 638, 646, 647, 649, 655, 669, 674, 685, 686
Offset: 1

Views

Author

M. F. Hasler, Jan 20 2014

Keywords

Comments

Charles R Greathouse IV asked for a proof showing that this sequence is infinite (SeqFan mailing list, Jan 2014).
Significant jumps occur at a(3)=4=2*a(2), a(5)=10=2*a(4), a(9)=28=2*a(8), a(17)=82=2*a(16), a(31)=236 >> a(29)=122, a(47)=628 >> a(44)=302, a(70)=1622 >> a(66)=809, a(90)=4165 >> a(87)=2062, ... . Here, the size of the terms roughly doubles over the interval of very few indices. The indices such that a(n[k]) >= 2*a(n[k-1]) are n[k] = 3, 5, 9, 17, 30, 46, 69, 89, ... .
This sequence first differs from A003278 at the 21st term, which is 92 here but 91 in A003278. Up to 91, each natural number n that did not appear in this sequence failed to do so because there were two smaller numbers n-a and n-2a, with A229037(n-a) and A229037(n-2a) both equal to 1. 91 is missing from this sequence; in other words, A229037(91) is not 1, because A229037(27) = 9 and A229037(59) = 5. - Jack W Grahl, Dec 28 2014

Crossrefs

Subsequence of A241673.

Programs

  • Haskell
    a236246 n = a236246_list !! (n-1)
    a236246_list = filter ((== 1) . a229037) [1..]
    -- Reinhard Zumkeller, Apr 26 2014
    
  • Python
    A236246_list, A229037_list = [], []
    for n in range(10**6):
        i, j, b = 1, 1, set()
        while n-2*i >= 0:
            b.add(2*A229037_list[n-i]-A229037_list[n-2*i])
            i += 1
            while j in b:
                b.remove(j)
                j += 1
        A229037_list.append(j)
        if j == 1:
            A236246_list.append(n+1) # Chai Wah Wu, Dec 25 2014

A241673 Where powers of 2 occur in A229037.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 51, 56, 57, 64, 69, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 96, 97, 98, 99, 100, 101
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 26 2014

Keywords

Comments

A209229(A229037(a(n))) = 1.

Examples

			.    n  |    a(n)  | A229037(a(n))=2^k |    k
. ------+----------+-------------------+------
.    1  |       1  |             1     |    0
.    3  |       3  |             2     |    1
.    8  |       8  |             4     |    2
.   22  |      24  |             8     |    3
.   92  |     196  |            16     |    4
.  139  |     387  |            32     |    5
.  155  |     516  |            64     |    6
.  250  |    1274  |           128     |    7
.  371  |    3590  |           256     |    8
.  560  |    9309  |           512     |    9
.  851  |   23654  |          1024     |   10 .
		

Crossrefs

Cf. A236246 (subsequence).

Programs

  • Haskell
    a241673 n = a241673_list !! (n-1)
    a241673_list = filter ((== 1) . a209229 . a229037) [1..]

A293866 For n > 2: when computing A229037(n), there are up to floor((n-1)/2) forbidden values (i.e. values that would lead to an arithmetic progression); a(n) = greatest forbidden value when computing A229037(n).

Original entry on oeis.org

1, 3, 3, 1, 3, 3, 6, 6, 7, 7, 7, 7, 7, 7, 7, 6, 6, 7, 7, 7, 7, 7, 11, 11, 12, 13, 14, 12, 13, 14, 14, 15, 16, 14, 15, 16, 16, 17, 17, 16, 17, 17, 14, 15, 16, 16, 17, 17, 16, 17, 17, 12, 13, 14, 13, 13, 14, 14, 15, 16, 16, 16, 16, 18, 17, 24, 17, 21, 21, 18, 21
Offset: 3

Views

Author

Rémy Sigrist, Oct 18 2017

Keywords

Comments

The scatterplot of this sequence has interesting features, such as rectangular clusters of points.
For any n > 2, A229037(n) <= a(n) + 1, with equality for n=3, 6, 8, 24 (and possibly no other values).

Examples

			For n=7: A229037(7) must be distinct from:
- 2*A229037(7-1) - A229037(7-2) = 2*2 - 1 = 3,
- 2*A229037(7-2) - A229037(7-4) = 2*1 - 2 = 2,
- 2*A229037(7-3) - A229037(7-6) = 2*1 - 1 = 1.
Hence a(7) = 3.
		

Crossrefs

Cf. A229037.

Formula

a(n) = max_{j=1..floor((n-1)/2)} (2*A229037(n-j) - A229037(n-2*j)).

A344264 When computing A229037, the value of the n-th term will add up to n-1 new constraints on the n-1 following terms; a(n) is the number of new constraints that the computation of A229037(n) brings.

Original entry on oeis.org

0, 1, 2, 2, 2, 5, 5, 7, 7, 4, 4, 8, 3, 3, 9, 9, 16, 15, 9, 11, 12, 15, 15, 23, 12, 14, 23, 8, 7, 16, 6, 6, 15, 14, 26, 21, 5, 6, 10, 4, 4, 12, 11, 27, 24, 13, 19, 18, 34, 31, 49, 24, 28, 47, 46, 22, 19, 21, 23, 48, 18, 18, 44, 20, 39, 57, 47, 40, 38, 43, 46
Offset: 1

Views

Author

Rémy Sigrist, May 13 2021

Keywords

Comments

Once A229037(n) has been computed, we have the following constraints:
- for k = 1..n-1, A229037(n + k) <> 2*A229037(n) - A229037(n - k),
- if 2*A229037(n) - A229037(n - k) <= 0, then we ignore this constraint,
- if 2*A229037(n) - A229037(n - k) = 2*A229037(n') - A229037(n' - k')
for some n' < n and k' < n' such that n + k = n' + k',
then we also ignore this constraint.

Examples

			The first terms, alongside the corresponding value of A229037 (denoted by f(n)) and the new constraints, are:
  n  a(n)  f(n)  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19
  -  ----  ----  -  -  -  -  -  -  -  -  -  --  --  --  --  --  --  --  --  --  --
  1     0     1  .  .  .  .  .  .  .  .  .  .   .   .   .   .   .   .   .   .   .
  2     1     1  .  .  1  .  .  .  .  .  .  .   .   .   .   .   .   .   .   .   .
  3     2     2  .  .  .  3  3  .  .  .  .  .   .   .   .   .   .   .   .   .   .
  4     2     1  .  .  .  .  .  1  1  .  .  .   .   .   .   .   .   .   .   .   .
  5     2     1  .  .  .  .  .  .  .  1  1  .   .   .   .   .   .   .   .   .   .
  6     5     2  .  .  .  .  .  .  3  3  2   3   3  .   .   .   .   .   .   .   .
  7     5     2  .  .  .  .  .  .  .  2  3  .    2   3   3  .   .   .   .   .   .
  8     7     4  .  .  .  .  .  .  .  .  6   6   7   7   6   7   7  .   .   .   .
  9     7     4  .  .  .  .  .  .  .  .  .   4   6   6   7  .    6   7   7  .   .
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) < n.

A362942 Partial sums of A229037.

Original entry on oeis.org

1, 2, 4, 5, 6, 8, 10, 14, 18, 19, 20, 22, 23, 24, 26, 28, 32, 36, 38, 42, 46, 51, 56, 64, 69, 74, 83, 84, 85, 87, 88, 89, 91, 93, 97, 101, 102, 103, 105, 106, 107, 109, 111, 115, 119, 121, 125, 129, 134, 139, 147, 152, 157, 166, 175, 179, 183, 188, 193
Offset: 1

Views

Author

N. J. A. Sloane, Sep 12 2023

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = Block[{z = 1}, While[Catch[Do[If[z == 2*a[n - k] - a[n - 2*k], Throw@ True], {k, Floor[(n - 1)/2]}]; False], z++]; z]; Accumulate@ Array[a, 120] (* Michael De Vlieger, Sep 12 2023, after Giovanni Resta at A229037 *)
  • Python
    from itertools import count, islice
    def A362942_gen(): # generator of terms
        blist, c = [], 0
        for n in count(0):
            i, j, b = 1, 1, set()
            while n-(i<<1) >= 0:
                b.add((blist[n-i]<<1)-blist[n-2*i])
                i += 1
                while j in b:
                    j += 1
            blist.append(j)
            yield (c:=c+j)
    A362942_list = list(islice(A362942_gen(),30)) # Chai Wah Wu, Sep 12 2023

A368796 Distinct values of A229037, in order of appearance.

Original entry on oeis.org

1, 2, 4, 5, 8, 9, 10, 13, 11, 12, 14, 20, 3, 6, 7, 17, 18, 15, 22, 23, 21, 27, 16, 24, 28, 26, 25, 19, 29, 37, 34, 31, 39, 30, 36, 32, 54, 38, 35, 57, 55, 52, 46, 51, 40, 41, 64, 43, 58, 59, 63, 56, 65, 53, 62, 60, 47, 71, 61, 68, 67, 33, 73, 69, 70, 66, 48
Offset: 1

Views

Author

Rémy Sigrist, Jan 06 2024

Keywords

Comments

Is this a permutation of the positive integers?

Examples

			The first terms, alongside the first terms of A229037, are:
  n   a(n)  k   A229037(k)
  --  ----  --  ----------
   1     1   1           1
             2           1
   2     2   3           2
             4           1
             5           1
             6           2
             7           2
   3     4   8           4
             9           4
            10           1
		

Crossrefs

Cf. A229037.

A344322 a(n) is the number of forbidden values when computing A229037(n).

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 2, 3, 4, 3, 4, 4, 3, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8, 7, 9, 9, 8, 9, 9, 9, 8, 9, 9, 8, 8, 8, 8, 7, 8, 6, 8, 9, 7, 8, 9, 7, 9, 8, 9, 9, 8, 9, 10, 10, 11, 10, 11, 11, 11, 11, 11, 11, 13, 15, 14, 14, 13, 15, 17, 16, 17, 15, 16, 17, 16, 16, 17
Offset: 1

Views

Author

Rémy Sigrist, May 15 2021

Keywords

Comments

In other words, a(n) is the number of distinct positive terms of the form 2*A229037(n - k) - A229037(n - 2*k) with n > 2*k > 0.

Examples

			For n=14, we have:
- 2*A229037(13) - A229037(12) = 2*1 - 2 = 0,
- 2*A229037(12) - A229037(10) = 2*2 - 1 = 3,
- 2*A229037(11) - A229037(8) = 2*1 - 4 = -2,
- 2*A229037(10) - A229037(6) = 2*1 - 2 = 0,
- 2*A229037(9) - A229037(4) = 2*4 - 1 = 7,
- 2*A229037(8) - A229037(2) = 2*4 - 1 = 7,
- so a(14) = #{3, 7} = 2.
		

Crossrefs

Programs

  • PARI
    \\ See Links section.

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.

Original entry on oeis.org

1, 2, 4, 5, 10, 11, 13, 14, 28, 29, 31, 32, 37, 38, 40, 41, 82, 83, 85, 86, 91, 92, 94, 95, 109, 110, 112, 113, 118, 119, 121, 122, 244, 245, 247, 248, 253, 254, 256, 257, 271, 272, 274, 275, 280, 281, 283, 284, 325, 326, 328, 329, 334, 335, 337, 338, 352, 353
Offset: 1

Views

Author

Keywords

Comments

That is, there are no three elements A, B and C such that B - A = C - B.
Positions of 1's in Richard Stanley's Forest Fire sequence A309890. - N. J. A. Sloane, Dec 01 2019
Subtracting 1 from each term gives A005836 (ternary representation contains no 2's). - N. J. A. Sloane, Dec 01 2019
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
Sums of distinct powers of 3, translated by 1.
Positions of 0 in A189820; complement of A189822. - Clark Kimberling, May 26 2011
Also, Stanley sequence S(1): see OEIS Index under Stanley sequences (link below). - M. F. Hasler, Jan 18 2016
Named after the Hungarian-Australian mathematician George Szekeres (1911-2005). - Amiram Eldar, May 07 2021
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

Examples

			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 + ...
		

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, p. 164.
  • Richard K. Guy, Unsolved Problems in Number Theory, E10.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Equals 1 + A005836. Cf. A001511, A098871.
Row 0 of array in A093682.
Summary of increasing sequences avoiding arithmetic progressions of specified lengths (the second of each pair is obtained by adding 1 to the first):
3-term AP: A005836 (>=0), A003278 (>0);
4-term AP: A005839 (>=0), A005837 (>0);
5-term AP: A020654 (>=0), A020655 (>0);
6-term AP: A020656 (>=0), A005838 (>0);
7-term AP: A020657 (>=0), A020658 (>0);
8-term AP: A020659 (>=0), A020660 (>0);
9-term AP: A020661 (>=0), A020662 (>0);
10-term AP: A020663 (>=0), A020664 (>0).
Cf. A003002, A229037 (the Forest Fire sequence), A309890 (Stanley's version).
Similar formula:
If A_n=(a(1),a(2),...,a(2^n)), then A_(n+1)=(A_n,A_n+4^n) produces A098871;
If A_n=(a(1),a(2),...,a(2^n)), then A_(n+1)=(A_n,A_n+2*3^n) produces A191106.

Programs

  • Julia
    function a(n)
        return 1 + parse(Int, bitstring(n-1), base=3)
    end # Gabriel F. Lipnik, Apr 16 2021
  • Maple
    a:= proc(n) local m, r, b; m, r, b:= n-1, 1, 1;
          while m>0 do r:= r+b*irem(m, 2, 'm'); b:= b*3 od; r
        end:
    seq(a(n), n=1..100); # Alois P. Heinz, Aug 17 2013
  • Mathematica
    Take[ Sort[ Plus @@@ Subsets[ Table[3^n, {n, 0, 6}]]] + 1, 58] (* Robert G. Wilson v, Oct 23 2004 *)
    a[1] = 0; h = 180;
    Table[a[3 k - 2] = a[k], {k, 1, h}];
    Table[a[3 k - 1] = a[k], {k, 1, h}];
    Table[a[3 k] = 1, {k, 1, h}];
    Table[a[n], {n, 1, h}]   (* A189820 *)
    Flatten[Position[%, 0]]  (* A003278 *)
    Flatten[Position[%%, 1]] (* A189822 *)
    (* A003278 from A189820, from Clark Kimberling, May 26 2011 *)
    Table[FromDigits[IntegerDigits[n, 2], 3] + 1, {n, 0, 57}] (* Amit Munje, Jun 03 2018 *)
  • PARI
    a(n)=1+sum(i=1,n-1,(1+3^valuation(i,2))/2) \\ Ralf Stephan, Jan 21 2014
    
  • 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
    
  • Python
    def A003278(n):
        return int(format(n-1,'b'),3)+1 # Chai Wah Wu, Jan 04 2015
    

Formula

a(2*k + 2) = a(2*k + 1) + 1, a(2^k + 1) = 2*a(2^k).
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
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
Conjecture: a(n) = (A191107(n) + 2)/3 = (A055246(n) + 5)/6. - L. Edson Jeffery, Nov 26 2015
a(n) mod 2 = A010059(n). - Arie Bos, Aug 13 2022

A235265 Primes whose base-3 representation also is the base-2 representation of a prime.

Original entry on oeis.org

3, 13, 31, 37, 271, 283, 733, 757, 769, 1009, 1093, 2281, 2467, 2521, 2551, 2917, 3001, 3037, 3163, 3169, 3187, 3271, 6673, 7321, 7573, 9001, 9103, 9733, 19801, 19963, 20011, 20443, 20521, 20533, 20749, 21871, 21961, 22123, 22639, 22717, 27253, 28711, 28759, 29173, 29191, 59077, 61483, 61507, 61561, 65701, 65881
Offset: 1

Views

Author

M. F. Hasler, Jan 05 2014

Keywords

Comments

This sequence and A235383 and A229037 are winners in the contest held at the 2014 AMS/MAA Joint Mathematics Meetings. - T. D. Noe, Jan 20 2014
This sequence was motivated by work initiated by V.J. Pohjola's post to the SeqFan list, which led to a clarification of the definition and correction of some errors, in sequences A089971, A089981 and A090707 through A090721. These sequences use "rebasing" (terminology of A065361) from some base b to base 10. Sequences A065720 - A065727 follow the same idea but use rebasing in the other sense, from base 10 to base b. The observation that only (10,b) and (b,10) had been considered so far led to the definition of this and related sequences: In a systematic approach, it seems natural to start with the smallest possible pairs of different bases, (2,3) and (3,2), then (2 <-> 4), (3 <-> 4), (2 <-> 5), etc.
Among the two possibilities using the smallest possible bases, 2 and 3, the present one seems a little bit more interesting, among others because not every base-3 representation is a valid base-2 representation (in contrast to the opposite case). This is also a reason why the present sequence grows much faster than the partner sequence A235266.

Examples

			3 = 10_3 and 10_2 = 2 is prime. 13 = 111_3 and 111_2 = 7 is prime.
		

Crossrefs

Subset of A077717.
Cf. A235266, A065720 and A036952, A065721 - A065727, A235394, A235395, A089971 and A020449, A089981, A090707 - A091924, A235461 - A235482. See M. F. Hasler's OEIS wiki page for further cross-references.

Programs

  • Maple
    N:= 1000: # to get the first N terms
    count:= 0:
    for i from 1 while count < N do
       p2:= ithprime(i);
       L:= convert(p2,base,2);
       p3:= add(3^(j-1)*L[j],j=1..nops(L));
       if isprime(p3) then
          count:= count+1;
          A235265[count]:= p3;
       fi
    od:
    [seq(A235265[i], i=1..N)]; # Robert Israel, May 04 2014
  • Mathematica
    b32pQ[n_]:=Module[{idn3=IntegerDigits[n,3]},Max[idn3]<2&&PrimeQ[ FromDigits[ idn3,2]]]; Select[Prime[Range[7000]],b32pQ] (* Harvey P. Dale, Apr 24 2015 *)
  • PARI
    is(p,b=2,c=3)=vecmax(d=digits(p,c))
    				
  • Python
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        p = 2
        while True:
            p3 = sum(3**i for i, bi in enumerate(bin(p)[2:][::-1]) if bi=='1')
            if isprime(p3):
                yield p3
            p = nextprime(p)
    g = agen()
    print([next(g) for n in range(1, 52)]) # Michael S. Branicky, Jan 16 2022
Showing 1-10 of 59 results. Next