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.

A106264 Diagonal sums of number triangle A106262.

Original entry on oeis.org

1, 0, 1, 2, 2, 4, 2, 4, 6, 7, 7, 8, 14, 10, 13, 12, 15, 19, 22, 22, 23, 25, 25, 44, 44, 40, 28, 50, 44, 54, 52, 55, 50, 66, 53, 72, 83, 80, 58, 73, 82, 110, 114, 123, 127, 113, 91, 112, 158, 137, 117, 122, 152, 135, 166, 160, 211, 206, 171, 219, 240, 201, 188, 194, 236
Offset: 0

Views

Author

Paul Barry, Apr 28 2005

Keywords

Crossrefs

Cf. A106262.

Programs

  • Magma
    [(&+[2^(n-2*k) mod (k+2): k in [0..Floor(n/2)]]): n in [0..80]]; // G. C. Greubel, Jan 10 2023
    
  • Mathematica
    Table[Sum[Mod[2^(n-2*k), k+2], {k,0,Floor[n/2]}], {n,0,80}] (* G. C. Greubel, Jan 10 2023 *)
  • SageMath
    def A106264(n): return sum( (2^(n-2*k)%(k+2)) for k in range(n//2+1) )
    [A106264(n) for n in range(81)] # G. C. Greubel, Jan 10 2023

Formula

a(n) = Sum_{k=0..floor(n/2)} ( 2^(n-2*k) mod (k+2) ).

A106263 Row sums of number triangle A106262.

Original entry on oeis.org

1, 1, 3, 4, 5, 8, 12, 11, 16, 16, 28, 27, 36, 34, 45, 53, 60, 60, 66, 72, 86, 104, 111, 95, 119, 109, 161, 182, 185, 161, 175, 169, 199, 210, 249, 258, 310, 248, 340, 332, 356, 297, 370, 352, 424, 428, 465, 502, 500, 450, 547, 590, 613, 588, 630, 569, 595, 630
Offset: 0

Views

Author

Paul Barry, Apr 28 2005

Keywords

Formula

a(n)=sum{k=0..n, (2^(n-k) mod k+2)}

A062173 a(n) = 2^(n-1) mod n.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 1, 0, 4, 2, 1, 8, 1, 2, 4, 0, 1, 14, 1, 8, 4, 2, 1, 8, 16, 2, 13, 8, 1, 2, 1, 0, 4, 2, 9, 32, 1, 2, 4, 8, 1, 32, 1, 8, 31, 2, 1, 32, 15, 12, 4, 8, 1, 14, 49, 16, 4, 2, 1, 8, 1, 2, 4, 0, 16, 32, 1, 8, 4, 22, 1, 32, 1, 2, 34, 8, 9, 32, 1, 48, 40, 2, 1, 32, 16, 2, 4, 40, 1, 32, 64, 8, 4, 2, 54, 32, 1, 58, 58, 88, 1, 32, 1, 24, 46
Offset: 1

Views

Author

Henry Bottomley, Jun 12 2001

Keywords

Comments

If p is an odd prime then a(p)=1. However, a(n) is also 1 for pseudoprimes to base 2 such as 341.

Examples

			a(5) = 2^(5-1) mod 5 = 16 mod 5 = 1.
		

Crossrefs

Cf. A176997 (after the initial term, gives the positions of ones).

Programs

  • Haskell
    import Math.NumberTheory.Moduli (powerMod)
    a062173 n = powerMod 2 (n - 1) n  -- Reinhard Zumkeller, Oct 17 2015
    
  • Magma
    [Modexp(2,n-1,n): n in [1..110]]; // G. C. Greubel, Jan 11 2023
    
  • Mathematica
    Array[Mod[2^(# - 1), #] &, 105] (* Michael De Vlieger, Jul 01 2018 *)
    Array[PowerMod[2,#-1,#]&,120] (* Harvey P. Dale, May 17 2023 *)
  • PARI
    A062173(n) = if(1==n, 0, lift(Mod(2, n)^(n-1))); \\ Antti Karttunen, Jul 01 2018
    
  • SageMath
    [power_mod(2,n-1,n) for n in range(1,110)] # G. C. Greubel, Jan 11 2023

Formula

a(n) = A106262(2*n-3, n-2). - G. C. Greubel, Jan 11 2023

Extensions

More terms from Antti Karttunen, Jul 01 2018

A112983 a(n) = 2^(n+1) mod n.

Original entry on oeis.org

0, 0, 1, 0, 4, 2, 4, 0, 7, 8, 4, 8, 4, 8, 1, 0, 4, 2, 4, 12, 16, 8, 4, 8, 14, 8, 25, 4, 4, 8, 4, 0, 16, 8, 1, 20, 4, 8, 16, 32, 4, 2, 4, 32, 34, 8, 4, 32, 11, 48, 16, 32, 4, 2, 31, 8, 16, 8, 4, 32, 4, 8, 16, 0, 64, 62, 4, 32, 16, 18, 4, 56, 4, 8, 61, 32, 36, 50, 4
Offset: 1

Views

Author

Paul Barry, Oct 08 2005

Keywords

Examples

			a(3) = 2^4 mod 3 = 16 mod 3 = 1.
		

Crossrefs

Programs

  • Magma
    [Modexp(2,n+1,n): n in [1..120]]; // G. C. Greubel, Jan 11 2023
    
  • Mathematica
    Table[PowerMod[2, n + 1, n], {n, 100}] (* T. D. Noe, Aug 13 2012 *)
  • Python
    print([2**(n+1) % n for n in range(1,77)])
    # Alex Ratushnyak, Aug 12 2012
    
  • SageMath
    [power_mod(2,n+1,n) for n in range(1,120)] # G. C. Greubel, Jan 11 2023

Formula

a(n) = A106262(2*n-1, n-2). - G. C. Greubel, Jan 11 2023

Extensions

Name, data and offset corrected by Alex Ratushnyak, Aug 12 2012

A213859 a(n) = 2^n mod (n+2).

Original entry on oeis.org

1, 2, 0, 3, 4, 4, 0, 2, 6, 6, 4, 7, 8, 2, 0, 9, 16, 10, 4, 2, 12, 12, 16, 8, 14, 20, 4, 15, 16, 16, 0, 2, 18, 22, 16, 19, 20, 2, 24, 21, 16, 22, 4, 38, 24, 24, 16, 32, 6, 2, 4, 27, 34, 52, 8, 2, 30, 30, 4, 31, 32, 2, 0, 8, 16, 34, 4, 2, 46, 36, 16, 37, 38, 17
Offset: 0

Views

Author

Alex Ratushnyak, Jun 22 2012

Keywords

Comments

Conjectures:
1. Indices of zeros: 2^(x+2)-2, x >= 0.
2. There are infinitely many n's such that a(n)=n.
3. Every integer k >= 0 appears in a(n) at least once.
4. Every k >= 0 appears in a(n) infinitely many times.

Crossrefs

Programs

  • Magma
    [Modexp(2,n,n+2): n in [0..120]]; // G. C. Greubel, Jan 11 2023
    
  • Mathematica
    Table[PowerMod[2, n, n+2], {n, 0, 100}] (* T. D. Noe, Jun 26 2012 *)
  • Python
    print([2**n % (n+2) for n in range(222)])
    
  • SageMath
    [power_mod(2,n,n+2) for n in range(121)] # G. C. Greubel, Jan 11 2023

Formula

a(n) = 2^n mod (n+2).
a(n) = A106262(2*n, n). - G. C. Greubel, Jan 11 2023
Showing 1-5 of 5 results.