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

A133900 a(n) = period of the sequence {b(m), m>=0}, defined by b(m):=binomial(m+n,n) mod n.

Original entry on oeis.org

1, 4, 9, 16, 25, 72, 49, 64, 81, 400, 121, 864, 169, 784, 675, 256, 289, 2592, 361, 1600, 1323, 3872, 529, 3456, 625, 5408, 729, 3136, 841, 324000, 961, 1024, 9801, 18496, 6125, 31104, 1369, 23104, 13689, 32000, 1681, 254016, 1849, 15488, 30375, 33856
Offset: 1

Views

Author

Hieronymus Fischer, Oct 15 2007, Oct 20 2007

Keywords

Comments

This is the analog of the sequence of Pisano periods (A001175) for binomial factors.
n^2 always divides a(n).
A prime p is a factor of a(n) if and only if it is a factor of n (i.e., a(n) and n have the same prime factors).

Examples

			a(3)=9 since binomial(m+3,3) mod 3, m>=0, is periodic with period length 3^2=9 (see A133883).
a(6)=72 since binomial(m+6,6) mod 6, m>=0, is periodic with period length 4*6^2=72 (see A133886).
		

Crossrefs

Formula

a(n)=n^2 if n is a prime or a power of a prime.

A133872 Period 4: repeat [1, 1, 0, 0].

Original entry on oeis.org

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

Views

Author

Hieronymus Fischer, Oct 10 2007

Keywords

Comments

Partial sums of A056594.
Let i=sqrt(-1) and S(n) = Sum_{k=0..n-1} exp(2*Pi*i*k^2/n) for n>=1 the famous Gauss sum. Then S(n) = (a(n)+a(n+1)*i)*sqrt(n). - Franz Vrabec, Nov 08 2007
a(A042948(n)) = 1; a(A042964(n)) = 0. - Reinhard Zumkeller, Oct 03 2008
a(n) is also the real part of partial sum of powers of the complex unit i. - Enrique Pérez Herrero, Aug 16 2009
Periodic sequences having a period of 2k and composed of k ones followed by k zeros have a closed formula of floor(((n+k) mod 2k)/k). Listed sequences of this form are: k=1..A000035(n+1), k=2..A133872(n), k=3..A088911, k=4..A131078(n), k=5..A112713(n-1). - Gary Detlefs, May 17 2011
0.repeat(0,0,1,1) is 1/5 in base 2, due to 1/5 = (3/16)/(1-1/16). For the general case see 1/A062158(n) in base n >= 2. Here n = 2. - Wolfdieter Lang, Jun 20 2014
a(n) (for n>=1) is the determinant of the n X n Toeplitz matrix M satisfying: M(i,j)=1 if -1<=j-i<=2 and 0 otherwise. - Dmitry Efimov, Jun 23 2015
a(n) (for n>=1) is the difference between numbers of even and odd permutations p of 1,2,...,n such that -1 <= p(i)-i <= 2 for i=1,2,...,n. - Dmitry Efimov, Jan 08 2016
The binomial transform is 1, 2, 3, 4, 6, 12,... (see A038504). - R. J. Mathar, Feb 25 2023

Examples

			G.f. = 1 + x + x^4 + x^5 + x^8 + x^9 + x^12 + x^13 + x^16 + x^17 + x^20 + ...
		

Crossrefs

Programs

Formula

a(n) = (1 + floor(n/2)) mod 2.
a(n) = A004526(A000035(n+2)).
a(n) = 1 + floor(n/2) - 2*floor((n+2)/4).
a(n) = (((n+2) mod 4) - (n mod 2))/2.
a(n) = ((n + 2 - (n mod 2))/2) mod 2.
a(n) = ((2*n + 3 + (-1)^n)/4) mod 2.
a(n) = (1 + (-1)^((2*n - 1 + (-1)^n)/4))/2.
a(n) = binomial(n+2, n) mod 2 = binomial(n+2, 2) mod 2.
a(n) = A000217(n+1) mod 2.
G.f.: (1+x)/(1-x^4) = 1/((1-x)(1+x^2)).
a(n) = 1/2 + (1/2)*cos(Pi*n/2) + (1/2)*sin(Pi*n/2). a(n) = A021913(n+2). - R. J. Mathar, Nov 15 2007
From Jaume Oliver Lafont, Dec 05 2008: (Start)
a(n) = 1/2 + sin((2n+1)Pi/4)/sqrt(2).
a(n) = 1/2 + cos((2n-1)Pi/4)/sqrt(2). (End)
a(n) = Re(Sum_{k=0..n} i^k), where i=sqrt(-1) and Re is the real part of a complex number. a(n) = (1/2)*((Sum_{k=0..n} i^k) + Sum_{k=0..n} i^-k) = Re((1/2)*(1 + i)*(1 - i^(n+1))). - Enrique Pérez Herrero, Aug 16 2009
a(n) = (1 + i^(n*(n-1)))/2, where i=sqrt(-1). - Bruno Berselli, May 18 2011
a(n) = (Sum_{k=1..n} k^j) mod 2, for any j. - Gary Detlefs, Dec 28 2011
a(n) = a(n-1) - a(n-2) + a(n-3) for n>2. - Jean-Christophe Hervé, May 01 2013
a(n) = 1 - floor(n/2) + 2*floor(n/4) = 1 - A004526(n) + A122461(n). - Wesley Ivan Hurt, Dec 06 2013
a(n) = (1 + (-1)^floor(n/2))/2. - Wesley Ivan Hurt, Apr 17 2014
a(n) = A054925(n+2) - A011848(n+2). - Wesley Ivan Hurt, Jun 09 2014
Euler transform of length 4 sequence [1, -1, 0, 1]. - Michael Somos, Sep 26 2014
a(n) = a(1-n) for all n in Z. - Michael Somos, Sep 26 2014
From Ilya Gutkovskiy, Jul 09 2016: (Start)
Inverse binomial transform of A038504(n+1).
E.g.f.: (exp(x) + sin(x) + cos(x))/2. (End)
a(n) = (1 + (-1)^(n*(n-1)/2))/2. - Guenther Schrack, Apr 04 2019

Extensions

Definition rewritten by N. J. A. Sloane, Apr 30 2009

A042964 Numbers that are congruent to 2 or 3 mod 4.

Original entry on oeis.org

2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31, 34, 35, 38, 39, 42, 43, 46, 47, 50, 51, 54, 55, 58, 59, 62, 63, 66, 67, 70, 71, 74, 75, 78, 79, 82, 83, 86, 87, 90, 91, 94, 95, 98, 99, 102, 103, 106, 107, 110, 111, 114, 115, 118, 119, 122, 123, 126, 127
Offset: 1

Views

Author

Keywords

Comments

Also numbers m such that binomial(m+2, m) mod 2 = 0. - Hieronymus Fischer, Oct 20 2007
Also numbers m such that floor(1+(m/2)) mod 2 = 0. - Hieronymus Fischer, Oct 20 2007
Partial sums of the sequence 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, ... which has period 2. - Hieronymus Fischer, Oct 20 2007
In groups of four add and divide by two the odd and even numbers. - George E. Antoniou, Dec 12 2001
From Jeremy Gardiner, Jan 22 2006: (Start)
Comments on the "mystery calculator". There are 6 cards.
Card 0: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, ... (A005408 sequence).
Card 1: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31, 34, 35, 38, 39, ... (this sequence).
Card 2: 4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31, 36, 37, 38, 39, ... (A047566).
Card 3: 8, 9, 10, 11, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31, 40, 41, 42, ... (A115419).
Card 4: 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 48, 49, 50, ... (A115420).
Card 5: 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, ... (A115421).
The trick: You secretly select a number between 1 and 63 from one of the cards. You indicate to me the cards on which that number appears; I tell you the number you selected!
The solution: I add together the first term from each of the indicated cards. The total equals the selected number. The numbers in each sequence all have a "1" in the same position in their binary expansion. Example: You indicate cards 1, 3 and 5. Your selected number is 2 + 8 + 32 = 42.
Numbers having a 1 in position 1 of their binary expansion. One of the mystery calculator sequences: A005408, A042964, A047566, A115419, A115420, A115421. (End)
Complement of A042948. - Reinhard Zumkeller, Oct 03 2008
Also the 2nd Witt transform of A040000 [Moree]. - R. J. Mathar, Nov 08 2008
In general, sequences of numbers congruent to {a,a+i} mod k will have a closed form of (k-2*i)*(2*n-1+(-1)^n)/4+i*n+a, from offset 0. - Gary Detlefs, Oct 29 2013
Union of A004767 and A016825; Fixed points of A098180. - Wesley Ivan Hurt, Jan 14 2014, Oct 13 2015

Crossrefs

Programs

  • Magma
    [2*n+((-1)^(n-1)-1)/2 : n in [1..100]]; // Wesley Ivan Hurt, Oct 13 2015
    
  • Magma
    [n: n in [1..150] | n mod 4 in [2, 3]]; // Vincenzo Librandi, Oct 13 2015
    
  • Maple
    A042964:=n->2*n+((-1)^(n-1)-1)/2; seq(A042964(n), n=1..100); # Wesley Ivan Hurt, Jan 07 2014
  • Mathematica
    Flatten[Table[4n + {2, 3}, {n, 0, 31}]] (* Alonso del Arte, Feb 07 2013 *)
    Select[Range[200],MemberQ[{2,3},Mod[#,4]]&] (* or *) LinearRecurrence[ {1,1,-1},{2,3,6},90] (* Harvey P. Dale, Nov 28 2018 *)
  • PARI
    a(n)=2*n+2-n%2
    
  • PARI
    Vec((2+x+x^2)/((1-x)*(1-x^2)) + O(x^100)) \\ Altug Alkan, Oct 13 2015

Formula

a(n) = A047406(n)/2.
From Michael Somos, Jan 12 2000: (Start)
G.f.: x*(2+x+x^2)/((1-x)*(1-x^2)).
a(n) = a(n-1) + 2 + (-1)^n. (End)
a(n) = 2n if n is odd, otherwise n = 2n - 1. - Amarnath Murthy, Oct 16 2003
a(n) = (3 + (-1)^(n-1))/2 + 2*(n-1) = 2n + 2 - (n mod 2). - Hieronymus Fischer, Oct 20 2007
A133872(a(n)) = 0. - Reinhard Zumkeller, Oct 03 2008
a(n) = 4*n - a(n-1) - 3 (with a(1) = 2). - Vincenzo Librandi, Nov 17 2010
a(n) = 2*n + ((-1)^(n-1) - 1)/2. - Gary Detlefs, Oct 29 2013
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/8 - log(2)/4. - Amiram Eldar, Dec 05 2021
E.g.f.: 1 + ((4*x - 1)*exp(x) - exp(-x))/2. - David Lovler, Aug 08 2022

Extensions

Edited by N. J. A. Sloane, Jun 30 2008 at the suggestion of R. J. Mathar
Corrected by Jaroslav Krizek, Dec 18 2009

A105198 a(n) = n(n+1)/2 mod 4.

Original entry on oeis.org

0, 1, 3, 2, 2, 3, 1, 0, 0, 1, 3, 2, 2, 3, 1, 0, 0, 1, 3, 2, 2, 3, 1, 0, 0, 1, 3, 2, 2, 3, 1, 0, 0, 1, 3, 2, 2, 3, 1, 0, 0, 1, 3, 2, 2, 3, 1, 0, 0, 1, 3, 2, 2, 3, 1, 0, 0, 1, 3, 2, 2, 3, 1, 0, 0, 1, 3, 2, 2, 3, 1, 0, 0, 1, 3, 2, 2, 3, 1, 0, 0, 1, 3, 2, 2, 3, 1, 0, 0, 1, 3, 2, 2, 3, 1, 0, 0, 1, 3, 2, 2, 3, 1, 0, 0
Offset: 0

Views

Author

Oscar Takeshita, Apr 11 2005

Keywords

Comments

0,1,3,2,2,3,1,0 repeated indefinitely.
If N is any power of 2 then n(n+1)/2 mod N is a repeating pattern of length 2N. Moreover, the first N digits form a permutation P of A={0,1,...,N-1}. The subsequent N digits are P in the reversed order. The technique is useful for the generation of arbitrarily large pseudo-random permutations.

Crossrefs

Cf. triangular numbers A000217, A105332-A105340.
One less than A110549, A133882 shifted once right, with zero inserted to front.

Programs

Formula

From Paul Barry, Jul 26 2005: (Start)
G.f.: (x + 2x^2 + 2x^4 + x^5)/(1 - x + x^2 - x^3 + x^4 - x^5 + x^6 - x^7).
a(n) = a(n-1) - a(n-2) + a(n-3) - a(n-4) + a(n-5) - a(n-6) + a(n-7).
a(n) = cos(3*Pi*n/4 + Pi/4)/2 + (1/2 - sqrt(2)/2)*sin(3*Pi*n/4 + Pi/4) - (1/2 + sqrt(2)/2)*cos(Pi*n/4 + Pi/4) - sin(Pi*n/4 + Pi/4)/2 - cos(Pi*n/2)/2 + sin(Pi*n/2)/2 + 3/2. (End)
a(n) = (((n+1)^5 - n^5 - 1) mod 120)/30. - Gary Detlefs, Mar 25 2012
a(n) = -ceiling(n/2)*(-1)^n mod 4. - Wesley Ivan Hurt, Jul 13 2014

Extensions

More terms from James Sellers, Apr 21 2005

A133622 a(n) = 1 if n is odd, a(n) = n/2+1 if n is even.

Original entry on oeis.org

1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 1, 14, 1, 15, 1, 16, 1, 17, 1, 18, 1, 19, 1, 20, 1, 21, 1, 22, 1, 23, 1, 24, 1, 25, 1, 26, 1, 27, 1, 28, 1, 29, 1, 30, 1, 31, 1, 32, 1, 33, 1, 34, 1, 35, 1, 36, 1, 37, 1, 38, 1, 39, 1, 40, 1, 41, 1, 42, 1, 43, 1, 44, 1
Offset: 1

Views

Author

Hieronymus Fischer, Sep 30 2007

Keywords

Comments

a(n) is the count of terms a(n+1) present so far in the sequence, with a(n+1) included in the count; example: a(1) = 1 "says" that there is 1 term "2" so far in the sequence; a(2) = 2 "says" that there are 2 terms "1" so far in the sequence... etc. This comment was inspired by A039617. - Eric Angelini, Mar 03 2020

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a133622 n = (1 - m) * n' + 1 where (n', m) = divMod n 2
    a133622_list = concat $ transpose [[1, 1 ..], [2 ..]]
    -- Reinhard Zumkeller, Feb 20 2015
    
  • Maple
    seq([1,n][],n=2..100); # Robert Israel, May 27 2016
  • Mathematica
    Riffle[Range[2,50],1,{1,-1,2}] (* Harvey P. Dale, Jan 19 2013 *)
  • PARI
    a(n)=if(n%2,1,n/2+1) \\ Charles R Greathouse IV, Sep 02 2015

Formula

a(n)=1+(binomial(n+1,2)mod n)=1+(binomial(n+1,n-1)mod n).
a(n)=binomial(n+2,2) mod n = binomial(n+2,n) mod n for n>2.
a(n)=1+(1+(-1)^n)*n/4.
a(n)=1+(A000217(n) mod n).
a(n)=a(n-2)+1, if n is even, a(n)=a(n-2) if n is odd.
a(n)=a(n-2)+1-(n mod 2)=a(n-2)+(1+(-1)^n)/2 for n>2.
a(n)=(a(n-3)+a(n-2))/a(n-1) for n>3.
G.f.: g(x)=x(1+2x-x^2-x^3)/(1-x^2)^2.
G.f.: (Q(0)-1-x)/x^2, where Q(k)= 1 + (k+1)*x/(1 - x/(x + (k+1)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, Apr 23 2013
a(n) = 2*a(n-2)-a(n-4) for n > 4. - Chai Wah Wu, May 26 2016
E.g.f.: exp(x) - 1 + x*sinh(x)/2. - Robert Israel, May 27 2016
Showing 1-5 of 5 results.