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-8 of 8 results.

A274406 Numbers m such that 9 divides m*(m + 1).

Original entry on oeis.org

0, 8, 9, 17, 18, 26, 27, 35, 36, 44, 45, 53, 54, 62, 63, 71, 72, 80, 81, 89, 90, 98, 99, 107, 108, 116, 117, 125, 126, 134, 135, 143, 144, 152, 153, 161, 162, 170, 171, 179, 180, 188, 189, 197, 198, 206, 207, 215, 216, 224, 225, 233, 234, 242, 243, 251, 252, 260, 261, 269
Offset: 1

Views

Author

Bruno Berselli, Jun 20 2016

Keywords

Comments

Equivalently, numbers congruent to 0 or 8 mod 9.
Terms of A007494 with indices in A047264. Also, terms of A060464 with indices in A047335.

Crossrefs

Cf. A008591 (first bisection), A010689 (first differences), A017257 (second bisection).
Cf. similar sequences in which m*(m+1) is divisible by k: A014601 (k=4), A047208 (k=5), A007494 (k=3 and 6), A047335 (k=7), A047521 (k=8), this sequence (k=9).
Cf. A301451: numbers congruent to {1, 7} mod 9; A193910: numbers congruent to {2, 6} mod 9.

Programs

  • Magma
    [n: n in [0..300] | IsDivisibleBy(n*(n+1),9)];
  • Mathematica
    Select[Range[0, 300], Divisible[# (# + 1), 9] &]
  • PARI
    for(n=0, 300, if(n*(n+1)%9==0, print1(n", ")))
    
  • Sage
    [n for n in range(300) if 9.divides(n*(n+1))]
    

Formula

G.f.: x^2*(8 + x)/((1 + x)*(1 - x)^2).
a(n) = (18*n + 7*(-1)^n - 11)/4. Therefore: a(2*m) = 9*m-1, a(2*m+1) = 9*m. It follows that a(j)+a(k) and a(j)*a(k) belong to the sequence if j and k are not both even.
a(n) = -A090570(-n+2).
a(n) = a(n-1) + a(n-2) - a(n-3).
a(2*r+1) + a(2*r+s+1) = a(4*r+s+1) and a(2*r) + a(2*r+2*s+1) = a(4*r+2*s). A particular case provided by these identities: a(n) = a(n - 2*floor(n/6)) + a(2*floor(n/6) + 1).
E.g.f.: 1 + ((9*x - 2)*cosh(x) + 9*(x - 1)*sinh(x))/2. - Stefano Spezia, Apr 24 2021

A047239 Numbers that are congruent to {1, 2} (mod 6).

Original entry on oeis.org

1, 2, 7, 8, 13, 14, 19, 20, 25, 26, 31, 32, 37, 38, 43, 44, 49, 50, 55, 56, 61, 62, 67, 68, 73, 74, 79, 80, 85, 86, 91, 92, 97, 98, 103, 104, 109, 110, 115, 116, 121, 122, 127, 128, 133, 134, 139, 140, 145, 146, 151
Offset: 1

Views

Author

Keywords

Comments

If a(n) is the n-th Towers of Hanoi move, the smallest disc (#1) is on peg C. If n == (3,4) (mod 6), disc #1 is on peg B; and if n == (0,5) (mod 6) disc #1 is on peg A. Disc #1 moves every 1,3,5,7,...-th move in a rotational cycle CBACBACBA such that it's on peg C the first TOH move and stays there for the 2nd move (in which case disc #2 moves). Therefore disc #1 is on peg C in moves (1, 2, 7, 8, 13, ...). - Gary W. Adamson, Jun 22 2012
Conjecture: a(n) is the least positive integer > a(n-1) that is not equal to a(i) + a(j) + a(k) for any i <= j <= k <= n. - Clark Kimberling, Oct 09 2019

Crossrefs

Cf. A047264.

Programs

  • Mathematica
    Select[Range[200],MemberQ[{1,2},Mod[#,6]]&] (* or *) LinearRecurrence[ {1,1,-1},{1,2,7},80] (* Harvey P. Dale, Nov 23 2011 *)

Formula

a(n) = 3*(n-1) - (-1)^n. - Rolf Pleisch, Aug 04 2009
a(n) = 6*n - a(n-1) - 9 (with a(1)=1). - Vincenzo Librandi, Aug 05 2010
G.f. x*(1+x+4*x^2) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Oct 08 2011
a(n) = a(n-1) + a(n-2) - a(n-3) with a(1)=1, a(2)=2, a(3)=7. - Harvey P. Dale, Nov 23 2011
E.g.f.: 4 + 3*exp(x)*(x - 1) - exp(-x). - Stefano Spezia, Oct 09 2019
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt(3)*Pi/18 + log(2)/3. - Amiram Eldar, Dec 13 2021

A048700 Binary palindromes of odd length (written in base 10).

Original entry on oeis.org

1, 5, 7, 17, 21, 27, 31, 65, 73, 85, 93, 99, 107, 119, 127, 257, 273, 297, 313, 325, 341, 365, 381, 387, 403, 427, 443, 455, 471, 495, 511, 1025, 1057, 1105, 1137, 1161, 1193, 1241, 1273, 1285, 1317, 1365, 1397, 1421, 1453, 1501, 1533, 1539, 1571, 1619, 1651
Offset: 1

Views

Author

Antti Karttunen, Mar 07 1999

Keywords

Comments

Note: you get A006995 (all binary palindromes) if you take (after zero) alternatively 2^n (starting from 2^0 = 1) terms from A048700 and as many from A048701 and then each time, twice as many from both.
A178225(a(n)) = 1. - Reinhard Zumkeller, Oct 21 2011
Comment from Altug Alkan, Dec 03 2015: (Start)
a(6*k) is divisible by 9 for k > 0.
a(3*k+(-1)^k-2) is divisible by 3 for k > 1.
The minimum value of a(n+1) - a(n) occurs when n = 2.
A014551(n) appears in this sequence for n > 0. (End)

Crossrefs

Cf. A048701 (binary palindromes of even length), A002113 (decimal palindromes), A006995 (all binary palindromes).
Cf. also A178225.

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    import Data.List (unfoldr)
    a048700 n = a048700_list !! (n-1)
    a048700_list = f 1 $ singleton 1 where
       f z s = m : f (z+1) (insert (c 0) (insert (c 1) s')) where
         c d = foldl (\v d -> 2 * v + d) 0 $ (reverse b) ++ [d] ++ b
         b = unfoldr
             (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 2) z
         (m,s') = deleteFindMin s
    -- Reinhard Zumkeller, Oct 21 2011
    
  • Maple
    bit_i := (x,i) -> `mod`(floor(x/(2^i)),2);
    floor_log_2 := proc(n) local nn,i: nn := n; for i from -1 to n do if(0 = nn) then RETURN(i); fi: nn := floor(nn/2); od: end:
  • Mathematica
    Select[Range@ 1651, # == Reverse@ # && OddQ@ Length@ # &@ IntegerDigits[#, 2] &] (* Michael De Vlieger, Dec 03 2015 *)
  • PARI
    {a(n) = local(f); if( n<1, 0, f = length(binary(n)) - 1; 2^f*n + sum(i=1, f, bittest(n,i) * 2^(f-i)))}; /* Michael Somos, Nov 27 2002 */
    
  • Python
    def A048700(n):
        s = bin(n)[2:]
        return int(s+s[-2::-1],2) # Chai Wah Wu, Feb 26 2021

Formula

a(n) = (2^(floor_log_2(n)))*n + sum('(bit_i(n, i)*(2^(floor_log_2(n)-i)))', 'i'=1..floor_log_2(n));
a(A047264(n)) mod 3 = 0, for n > 1. - Altug Alkan, Dec 03 2015

A047227 Numbers that are congruent to {1, 2, 3, 4} mod 6.

Original entry on oeis.org

1, 2, 3, 4, 7, 8, 9, 10, 13, 14, 15, 16, 19, 20, 21, 22, 25, 26, 27, 28, 31, 32, 33, 34, 37, 38, 39, 40, 43, 44, 45, 46, 49, 50, 51, 52, 55, 56, 57, 58, 61, 62, 63, 64, 67, 68, 69, 70, 73, 74, 75, 76, 79, 80, 81, 82, 85, 86, 87, 88, 91, 92, 93, 94, 97, 98
Offset: 1

Views

Author

Keywords

Comments

a(k)^m is a term for k and m in N. - Jerzy R Borysowicz, Apr 18 2023

Crossrefs

Complement of A047264. Equals A203016 divided by 3.

Programs

  • Magma
    [n: n in [0..100] | n mod 6 in [1..4]]; // Vincenzo Librandi, Jan 06 2013
    
  • Maple
    A047227:=n->(6*n-5-I^(2*n)+(1+I)*I^(1-n)+(1-I)*I^(n-1))/4: seq(A047227(n), n=1..100); # Wesley Ivan Hurt, May 20 2016
  • Mathematica
    Complement[Range[100], Flatten[Table[{6n - 1, 6n}, {n, 0, 15}]]] (* Alonso del Arte, Jul 07 2011 *)
    Select[Range[100], MemberQ[{1, 2, 3, 4}, Mod[#, 6]]&] (* Vincenzo Librandi, Jan 06 2013 *)
  • PARI
    a(n)=([0,1,0,0,0; 0,0,1,0,0; 0,0,0,1,0; 0,0,0,0,1; -1,1,0,0,1]^(n-1)*[1;2;3;4;7])[1,1] \\ Charles R Greathouse IV, May 03 2023

Formula

From Johannes W. Meijer, Jul 07 2011: (Start)
a(n) = floor((n+2)/4) + floor((n+1)/4) + floor(n/4) + 2*floor((n-1)/4) + floor((n+3)/4).
G.f.: x*(1 + x + x^2 + x^3 + 2*x^4)/(x^5 - x^4 - x + 1). (End)
From Wesley Ivan Hurt, May 20 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
a(n) = (6n - 5 - i^(2n) + (1+i)*i^(1-n) + (1-i)*i^(n-1))/4 where i=sqrt(-1).
a(2n) = A047235(n), a(2n-1) = A047241(n). (End)
E.g.f.: (4 + sin(x) - cos(x) + (3*x - 2)*sinh(x) + 3*(x - 1)*cosh(x))/2. - Ilya Gutkovskiy, May 21 2016
From Wesley Ivan Hurt, May 21 2016: (Start)
a(n) = A047246(n) + 1.
a(n+2) - a(n+1) = A093148(n) for n>0.
a(1-n) = - A047247(n). (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt(3)*Pi/12 + 2*log(2)/3 - log(3)/4. - Amiram Eldar, Dec 17 2021

A047230 Numbers that are congruent to {3, 4} mod 6.

Original entry on oeis.org

3, 4, 9, 10, 15, 16, 21, 22, 27, 28, 33, 34, 39, 40, 45, 46, 51, 52, 57, 58, 63, 64, 69, 70, 75, 76, 81, 82, 87, 88, 93, 94, 99, 100, 105, 106, 111, 112, 117, 118, 123, 124, 129, 130, 135, 136, 141, 142, 147, 148
Offset: 1

Views

Author

Keywords

Comments

If a(n) = the n-th Towers of Hanoi move, the smallest disc (#1) is on peg B. (Cf. A047264, A047239). For TOH moves 1 and 2, disc #1 is on peg C. For moves 3 and 4, it's on peg B, and for moves 5 and 6, it's on peg A. The cycle continues CBACBACBA... for moves (7,8), (9,10), (11,12), etc. So disc #1 is on peg B for TOH moves (3, 4, 9, 10, 15, 16, ...). - Gary W. Adamson Jun 22 2012

Programs

  • Mathematica
    LinearRecurrence[{1,1,-1},{3,4,9},50] (* Harvey P. Dale, Dec 04 2018 *)
  • PARI
    a(n) = 3*n - 1 - (-1)^n \\ David Lovler, Aug 25 2022

Formula

a(n) = 6*n - a(n-1) - 5 (with a(1)=3). - Vincenzo Librandi, Aug 05 2010
From R. J. Mathar, Oct 08 2011: (Start)
a(n) = 3*n - 1 - (-1)^n.
G.f.: ( x*(3+x+2*x^2) ) / ( (1+x)*(x-1)^2 ).
(End)
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/(12*sqrt(3)) + log(2)/3 - log(3)/4. - Amiram Eldar, Dec 13 2021
E.g.f.: 2 + 3*x*exp(x) - 2*cosh(x). - David Lovler, Aug 25 2022

A057566 Number of collinear triples in a 3 X n rectangular grid.

Original entry on oeis.org

0, 1, 2, 8, 20, 43, 78, 130, 200, 293, 410, 556, 732, 943, 1190, 1478, 1808, 2185, 2610, 3088, 3620, 4211, 4862, 5578, 6360, 7213, 8138, 9140, 10220, 11383, 12630, 13966, 15392, 16913, 18530, 20248, 22068, 23995, 26030, 28178, 30440, 32821, 35322
Offset: 0

Views

Author

John W. Layman, Oct 04 2000

Keywords

Crossrefs

Second differences give A047264. Third differences are periodic {5, 1, 5, 1, ...} and form A010686. See A000938 for the n X n grid.

Programs

  • Mathematica
    LinearRecurrence[{3, -2, -2, 3, -1}, {0, 1, 2, 8, 20}, 50] (* Paolo Xausa, Feb 22 2024 *)

Formula

Conjecture: a(n) = 5*floor((2n^3 - 3n^2 - n)/24) + floor((2(n-1)^3 - 3(n-1)^2 - (n-1))/24) + n, which fits all of the listed terms.
From R. J. Mathar, May 23 2010: (Start)
a(n) = 3*a(n-1) - 2*a(n-2) - 2*a(n-3) + 3*a(n-4) - a(n-5) = n^3/2 - n^2 + n + (1-(-1)^n)/4.
G.f.: x*(1 - x + 4*x^2 + 2*x^3)/((1+x)*(x-1)^4). (End)

A176260 Periodic sequence: Repeat 5, 1.

Original entry on oeis.org

5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5
Offset: 0

Views

Author

Klaus Brockhaus, Apr 13 2010

Keywords

Comments

Interleaving of A010716 and A000012.
Also continued fraction expansion of (5+3*sqrt(5))/2.
Also decimal expansion of 17/33.
Essentially first differences of A047264.
Binomial transform of 5 followed by -A122803 without initial terms 1, -2.
Inverse binomial transform of 5 followed by A007283 without initial term 3.
Second inverse binomial transform of A168607 without initial term 3.
Exp( Sum_{n >= 1} a(n)*x^n/n ) = 1 + x + 3*x^2 + 3*x^3 + 6*x^4 + 6*x^5 + ... is the o.g.f. for A008805. - Peter Bala, Mar 13 2015

Crossrefs

Cf. A010716 (all 5's sequence), A000012 (all 1's sequence), A090550 (decimal expansion of (5+3*sqrt(5))/2), A010686 (repeat 1, 5), A047264 (congruent to 0 or 5 mod 6), A122803 (powers of -2), A007283 (3*2^n), A168607 (3^n+2), A008805.

Programs

  • Magma
    &cat[ [5, 1]: n in [0..52] ];
    [ 3+2*(-1)^n: n in [0..104] ];

Formula

a(n) = 3+2*(-1)^n.
a(n) = a(n-2) for n > 1; a(0) = 5, a(1) = 1.
a(n) = -a(n-1)+6 for n > 0; a(0) = 5.
a(n) = 5*((n+1) mod 2)+(n mod 2).
a(n) = A010686(n+1).
G.f.: (5+x)/(1-x^2).
From Amiram Eldar, Jan 01 2023: (Start)
Multiplicative with a(2^e) = 5, and a(p^e) = 1 for p >= 3.
Dirichlet g.f.: zeta(s)*(1+2^(2-s)). (End)
E.g.f.: 5*cosh(x) + sinh(x). - Stefano Spezia, Feb 09 2025

A354522 Square array A(n, k), n, k >= 0, read by antidiagonals; A(n, k) = g(f(n) + f(k)) where f denotes A001057 and g denotes its inverse.

Original entry on oeis.org

0, 1, 1, 2, 3, 2, 3, 0, 0, 3, 4, 5, 4, 5, 4, 5, 2, 1, 1, 2, 5, 6, 7, 6, 7, 6, 7, 6, 7, 4, 3, 0, 0, 3, 4, 7, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 6, 5, 2, 1, 1, 2, 5, 6, 9, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 8, 7, 4, 3, 0, 0, 3, 4, 7, 8, 11, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 12
Offset: 0

Views

Author

Rémy Sigrist, Sep 14 2022

Keywords

Comments

This sequence is directly related to A355278.
The function f is a bijection from the nonnegative integers to the integers (Z).
The nonnegative integers, together with (x,y) -> A(x,y), form an abelian group isomorph to the additive group Z (f and g act as isomorphisms).
As a consequence, each row and each column is a permutation of the nonnegative integers.

Examples

			Array A(n, k) begins:
  n\k |  0   1   2   3   4   5   6   7   8   9  10  11  12
  ----+---------------------------------------------------
    0 |  0   1   2   3   4   5   6   7   8   9  10  11  12
    1 |  1   3   0   5   2   7   4   9   6  11   8  13  10
    2 |  2   0   4   1   6   3   8   5  10   7  12   9  14
    3 |  3   5   1   7   0   9   2  11   4  13   6  15   8
    4 |  4   2   6   0   8   1  10   3  12   5  14   7  16
    5 |  5   7   3   9   1  11   0  13   2  15   4  17   6
    6 |  6   4   8   2  10   0  12   1  14   3  16   5  18
    7 |  7   9   5  11   3  13   1  15   0  17   2  19   4
    8 |  8   6  10   4  12   2  14   0  16   1  18   3  20
    9 |  9  11   7  13   5  15   3  17   1  19   0  21   2
   10 | 10   8  12   6  14   4  16   2  18   0  20   1  22
   11 | 11  13   9  15   7  17   5  19   3  21   1  23   0
   12 | 12  10  14   8  16   6  18   4  20   2  22   0  24
		

Crossrefs

Programs

  • PARI
    f(n) = - (-1)^n * ((n+1)\2)
    g(n) = if (n<=0, -2*n, 2*n-1)
    A(n, k) = g(f(n) + f(k))

Formula

A355278(n+1, k+1) = prime(1 + A(n, k)) (where prime(m) denotes the m-th prime number).
A(n, k) = A(k, n).
A(n, 0) = n.
A(n, A014681(n)) = 0.
A(m, A(n, k)) = A(A(m, n), k).
A(n, n) = A014601(n).
A(n, A(n, n)) = A047264(n+1).
A(A(n, n), A(n, n)) = A047521(n+1).
Showing 1-8 of 8 results.