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.

Previous Showing 31-40 of 64 results. Next

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

A060154 Table T(n,k) by antidiagonals of n^k mod k [n,k >= 1].

Original entry on oeis.org

0, 1, 0, 1, 0, 0, 1, 2, 1, 0, 1, 0, 0, 0, 0, 1, 2, 1, 1, 1, 0, 1, 4, 3, 0, 2, 0, 0, 1, 2, 3, 4, 1, 0, 1, 0, 1, 0, 3, 4, 0, 0, 1, 0, 0, 1, 8, 1, 4, 1, 1, 1, 2, 1, 0, 1, 4, 0, 0, 5, 0, 2, 0, 0, 0, 0, 1, 2, 9, 1, 1, 6, 1, 3, 1, 1, 1, 0, 1, 4, 3, 6, 8, 0, 0, 4, 4, 0, 2, 0, 0, 1, 2, 9, 4, 5, 0, 1, 1, 3, 0, 1, 0, 1, 0
Offset: 1

Views

Author

Henry Bottomley, Mar 12 2001

Keywords

Examples

			T(5,3) = 5^3 mod 3 = 125 mod 3 = 2.
Rows start:
  0, 1, 1, 1, 1, ...
  0, 0, 2, 0, 2, ...
  0, 1, 0, 1, 3, ...
  0, 0, 1, 0, 4, ...
  0, 1, 2, 1, 0, ...
		

Crossrefs

Rows include A057427, A015910, A056969.
Columns include A000004, A000035 (several times), A010872, A010874, A010876, A021559 and other periodic sequences.
Diagonals include A000004 and A057427.
Cf. A114448.

Formula

T(n, k) = A051129(n, k)-n*A060155(n, k).

A073797 a(n) = 2^n mod pi(n).

Original entry on oeis.org

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

Views

Author

Labos Elemer, Aug 12 2002

Keywords

Examples

			From _Michael De Vlieger_, Dec 09 2018: (Start)
a(2) = 0 since 2^2 mod PrimePi(2) = 4 mod 1 = 0.
a(5) = 2 since 2^5 mod PrimePi(5) = 32 mod 3 = 2. (End)
		

Crossrefs

Programs

  • Magma
    [2^n mod #PrimesUpTo(n): n in [2..100]]; // G. C. Greubel, Dec 10 2018
    
  • Mathematica
    Array[Mod[2^#, PrimePi@ #] &, 95, 2] (* Michael De Vlieger, Dec 09 2018 *)
    Table[PowerMod[2,n,PrimePi[n]],{n,2,100}] (* Harvey P. Dale, Aug 30 2021 *)
  • PARI
    for(n=2, 100, print1(lift(Mod(2^n, primepi(n))), ", ")) \\ G. C. Greubel, Dec 10 2018
    
  • Sage
    [mod(2^n, prime_pi(n)) for n in (2..100)] # G. C. Greubel, Dec 10 2018

Formula

a(n) = A000079(n) mod A000720(n).

A082493 a(n) = n*ceiling(2^n/n) - 2^n.

Original entry on oeis.org

0, 0, 1, 0, 3, 2, 5, 0, 1, 6, 9, 8, 11, 10, 7, 0, 15, 8, 17, 4, 13, 18, 21, 8, 18, 22, 1, 12, 27, 26, 29, 0, 25, 30, 17, 8, 35, 34, 31, 24, 39, 20, 41, 28, 28, 42, 45, 32, 19, 26, 43, 36, 51, 26, 12, 24, 49, 54, 57, 44, 59, 58, 55, 0, 33, 2, 65, 52, 61, 26, 69, 8, 71, 70, 7, 60, 59, 14
Offset: 1

Views

Author

Vladeta Jovovic, Apr 28 2003

Keywords

Comments

Least nonnegative k such that (2^n+k)/n is an integer.
If n is a power of 2, a(n) = 0; otherwise a(n) = n - A015910(n). - Robert Israel, Apr 08 2015

Crossrefs

Programs

Formula

a(n) = -(2^n) mod n. - Robert Israel, Apr 08 2015

A155836 2^(2^n) mod n.

Original entry on oeis.org

0, 0, 1, 0, 1, 4, 4, 0, 4, 6, 3, 4, 9, 2, 1, 0, 1, 16, 4, 16, 4, 16, 3, 16, 21, 16, 13, 16, 16, 16, 8, 0, 4, 18, 11, 16, 33, 16, 22, 16, 37, 16, 4, 20, 31, 6, 21, 16, 4, 16, 1, 16, 42, 52, 36, 16, 28, 54, 20, 16, 57, 16, 4, 0, 61, 16, 21, 52, 64, 16, 12, 16, 4, 16, 31, 24, 4, 16, 73, 16, 40
Offset: 1

Views

Author

T. D. Noe, Jan 28 2009

Keywords

Comments

From the randomness of the graph, it seems likely that every number will eventually occur. a(n)=1 for the n in A094358. When do 5 and 23 occur? The number 14 finally appears at n=34913. a(n) can be computed rapidly using two applications of the powermod function.

Examples

			a(1941491)=a(43228711)=a(75548489)=5 and a(100867561)=23. See A155886 for the first occurrence of each number. [From _T. D. Noe_, Jan 31 2009]
		

Crossrefs

A015910 (2^n mod n), A036236.

Programs

  • Mathematica
    Table[e=IntegerExponent[n,2]; d=n/2^e; k=MultiplicativeOrder[2,d]; r=PowerMod[2,n,k]-e; r=Mod[r,k]; 2^e PowerMod[2,r,d], {n, 100}]
    Table[PowerMod[2,2^n,n],{n,100}] (* Harvey P. Dale, Oct 16 2022 *)
  • PARI
    a(n)=my(ph=eulerphi(n));lift(Mod(2,n)^(ph+lift(Mod(2,ph)^n))) \\ Charles R Greathouse IV, Feb 24 2012

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

Original entry on oeis.org

0, 2, 2, 2, 8, 2, 2, 8, 2, 2, 8, 2, 7, 26, 2, 2, 8, 18, 2, 8, 2, 2, 17, 2, 30, 8, 2, 43, 8, 2, 2, 8, 32, 2, 8, 2, 2, 68, 18, 2, 80, 2, 32, 8, 2, 37, 8, 13, 2, 17, 2, 2, 92, 2, 2, 8, 2, 78, 44, 60, 112, 8, 57, 2, 8, 2, 128, 53, 2, 2, 8, 85, 32, 50, 2, 2, 53, 63, 2, 8, 151
Offset: 0

Views

Author

Juri-Stepan Gerasimov, Jan 13 2011

Keywords

Examples

			a(0) = (2^(2*0+1) mod (2*0+1))=(2 mod 1)=0.
		

Formula

a(n) = A015910(2n+1).

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

Original entry on oeis.org

0, 0, 2, 0, 3, 4, 1, 0, 5, 6, 8, 4, 8, 2, 2, 0, 8, 4, 8, 4, 11, 16, 8, 16, 3, 16, 23, 8, 8, 16, 8, 0, 32, 16, 2, 4, 8, 16, 32, 24, 8, 4, 8, 20, 23, 16, 8, 16, 22, 46, 32, 12, 8, 4, 7, 16, 32, 16, 8, 4, 8, 16, 32, 0, 63, 58, 8, 64, 32, 36, 8, 40, 8, 16, 47
Offset: 1

Views

Author

Alex Ratushnyak, Jul 22 2012

Keywords

Comments

Also a(n) = x^x mod (x-2), where x = n+2.
Indices of 0's: 2^k, k>=0.
Indices of 1's: 7, 511, 713, 11023, 15553, 43873, 81079, 95263, 323593, 628153, 2275183, 6520633, 6955513, 7947583, 10817233, 12627943, 14223823, 15346303, 19852423, 27923663, 28529473, ...
Conjecture: every integer k >= 0 appears in a(n) at least once.
Each number below 69 appears at least once. Some large first occurrences: a(39806401) = 25, a(259274569) = 33, a(10571927) = 55, a(18039353) = 81. - Charles R Greathouse IV, Jul 21 2015

Examples

			a(3) = 2^5 mod 3 = 32 mod 3 = 2.
		

Crossrefs

Programs

  • Maple
    A212844 := proc(n)
        modp( 2&^ (n+2),n) ;
    end proc: # R. J. Mathar, Jul 24 2012
  • Mathematica
    Table[PowerMod[2, n+2, n], {n, 79}] (* Alonso del Arte, Jul 22 2012 *)
  • PARI
    A212844(n)=lift(Mod(2,n)^(n+2)) \\ M. F. Hasler, Jul 23 2012
  • Python
    for n in range(1,99):
        print(2**(n+2) % n, end=',')
    

Formula

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

A245728 Numbers k that divide 2^k + 6.

Original entry on oeis.org

1, 2, 10, 1030, 10009593662, 13957196317, 55299492770, 3764656723270
Offset: 1

Views

Author

Derek Orr, Jul 30 2014

Keywords

Comments

No other terms below 10^15. Some larger terms: 2962089521722084981, 1376243703434217460265762. - Max Alekseyev, Sep 23 2016

Examples

			2^10 + 6 = 1030 is divisible by 10. Thus 10 is a term of this sequence.
		

Crossrefs

Programs

  • Maple
    select(n -> 2 &^ n + 6 mod n = 0, [$1..10^6]); # Robert Israel, Jul 30 2014
  • Mathematica
    Select[Range[10^5], Divisible[2^# + 6, #] &] (* Robert Price, Oct 12 2018 *)
  • PARI
    for(n=1,10^9,if(Mod(2,n)^n==Mod(-6,n),print1(n,", ")))

Extensions

a(5) from Jason G. Wurtzel, Sep 25 2014
a(6)-a(8) from Max Alekseyev, Sep 23 2016

A264922 Decimal expansion of constant z = Sum_{n>=1} {2^n/n} * n/2^n, where {x} is the fractional part of x.

Original entry on oeis.org

4, 1, 2, 9, 2, 0, 7, 6, 8, 6, 7, 1, 4, 9, 7, 6, 9, 2, 3, 1, 8, 7, 6, 4, 4, 6, 3, 3, 9, 1, 6, 6, 0, 2, 2, 3, 2, 6, 6, 3, 6, 5, 8, 0, 8, 5, 5, 9, 1, 6, 1, 5, 0, 1, 7, 1, 2, 0, 8, 7, 3, 8, 0, 9, 6, 5, 2, 9, 3, 3, 4, 5, 5, 2, 2, 8, 4, 2, 3, 7, 1, 0, 8, 3, 2, 2, 4, 0, 6, 8, 1, 1, 8, 9, 3, 7, 5, 4, 2, 6, 7, 0, 9, 4, 4, 0, 9, 6, 8, 1, 5, 9, 1, 8, 6, 8, 4, 5, 2, 3, 9, 0, 6, 7, 6, 7, 3, 7, 4, 3, 9, 4, 7, 7, 8, 7, 6, 7, 4, 4, 6, 5, 5, 6, 7, 1, 1, 4, 7, 6, 1, 0, 7, 8, 0, 4, 6, 5, 5, 3, 2, 9
Offset: 0

Views

Author

Paul D. Hanna, Dec 03 2015

Keywords

Examples

			z = 0.41292076867149769231876446339166022326636580855916\
15017120873809652933455228423710832240681189375426\
70944096815918684523906767374394778767446556711476\
10780465532930416417809262367754600548943347721936\
55335089998952017672435611201014919700656911176350\
62372182725523627777491225313970963752168821911399\
67310841379582079241875027376200157722800032983503\
52300500273468914504274753388182612540758874330051\
88409791519634550380640194311077029592977832839103\
92762052659306868595889500273010680885518723259637...
INFINITE SERIES.
z = 0/2 + 0/2^2 + 2/2^3 + 0/2^4 + 2/2^5 + 4/2^6 + 2/2^7 + 0/2^8 + 8/2^9 + 4/2^10 + 2/2^11 + 4/2^12 + 2/2^13 + 4/2^14 + 8/2^15 + 0/2^16 + 2/2^17 + 10/2^18 + 2/2^19 + 16/2^20 + 8/2^21 + 4/2^22 + 2/2^23 + 16/2^24 + 7/2^25 + 4/2^26 + 26/2^27 + 16/2^28 + 2/2^29 + 4/2^30 + 2/2^31 + 0/2^32 + 8/2^33 +...+ A015910(n)/2^n +...
		

Crossrefs

Cf. A015910 (2^n mod n), A264918, A264919, A264920, A264921.

Formula

z = Sum_{n>=1} (2^n mod n) / 2^n = Sum_{n>=1} A015910(n) / 2^n.

A073799 Numbers that begin a run of consecutive integers k such that PrimePi(k) divides 2^k.

Original entry on oeis.org

2, 7, 19, 53, 131, 311, 719, 1619, 3671, 8161, 17863, 38873, 84017, 180503, 386093, 821641, 1742537, 3681131, 7754077, 16290047, 34136029, 71378569, 148948139, 310248241, 645155197, 1339484197, 2777105129, 5750079047, 11891268401, 24563311309, 50685770167, 104484802057, 215187847711
Offset: 1

Views

Author

Labos Elemer, Aug 12 2002

Keywords

Comments

It seems that each term is a bit larger than twice the previous one.
Runs have lengths 3, 4, 4, 6, 6, 2, 8, 2, 2, 6, 18, 18, 30, 8, 24, 6, 2, 18, ..., respectively.
From Chai Wah Wu, Jan 27 2020: (Start)
Theorem: a(1) = 2 and a(n) = A033844(n) for n > 1. For n > 1, the length of the n-th run is prime(2^n+1)-prime(2^n) = A051439(n)-A033844(n) = A074325(n).
Proof: Let r > 1. If p = prime(2^r), then primepi(p) = 2^r.
primepi(p-1) = 2^r - 1. Since r > 1, 2^r - 1 > 2 and odd and thus does not divide any power of 2.
In addition 2^r < p and thus divides 2^p. This means that p is a term. Let q be such that p < q < prime(2^r+1). Then primepi(q) = 2^r and divides 2^q. Since primepi(q-1) = 2^r and divides 2^(q-1), this means that q does not start a run and thus is not a term.
Let w be such that prime(2^r+1) <= w < prime(2^(r+1)). Then 2^r + 1 <= primepi(w) < 2^(r+1) and does not divide any power of 2. This means that w is not a term.
(End)

Crossrefs

Programs

  • Mathematica
    aQ[k_] := Divisible[2^k, PrimePi[k]]; s = {}; len = {}; n = 2; While[Length[s] < 10, While[! aQ[n], n++]; n1 = n; While[aQ[n], n++]; If[n > n1, AppendTo[s, n1]; AppendTo[len, n - n1]]; n++]; s (* Amiram Eldar, Dec 11 2018 *)
  • PARI
    a(n) = if(n==1, 2, prime(2^n)); \\ Jinyuan Wang, Mar 01 2020
  • Python
    from sympy import prime
    def A073799(n):
        return 2 if n == 1 else prime(2**n) # Chai Wah Wu, Jan 27 2020
    

Formula

Solutions to 2^(x-1) mod PrimePi(x-1) > 0 but 2^x mod PrimePi(x) = 0.
a(n) = A033844(n) for n > 1. - Chai Wah Wu, Jan 27 2020

Extensions

Edited by Jon E. Schoenfield, Dec 10 2018
a(15)-a(18) from Amiram Eldar, Dec 11 2018
a(19)-a(33) from Chai Wah Wu, Jan 27 2020
Previous Showing 31-40 of 64 results. Next