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 41-50 of 64 results. Next

A082494 a(n) = n - (2^n (mod n)).

Original entry on oeis.org

1, 2, 1, 4, 3, 2, 5, 8, 1, 6, 9, 8, 11, 10, 7, 16, 15, 8, 17, 4, 13, 18, 21, 8, 18, 22, 1, 12, 27, 26, 29, 32, 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, 64, 33, 2, 65, 52, 61, 26, 69, 8, 71, 70, 7, 60, 59
Offset: 1

Views

Author

Anonymous, Apr 28 2003

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> n-(2&^n mod n):
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 08 2015

A112987 a(n) = 2^(2^n mod n) for n > 0; a(0) = 2.

Original entry on oeis.org

2, 1, 1, 4, 1, 4, 16, 4, 1, 256, 16, 4, 16, 4, 16, 256, 1, 4, 1024, 4, 65536, 256, 16, 4, 65536, 128, 16, 67108864, 65536, 4, 16, 4, 1, 256, 16, 262144, 268435456, 4, 16, 256, 65536, 4, 4194304, 4, 65536, 131072, 16, 4, 65536, 1073741824, 16777216, 256
Offset: 0

Views

Author

Paul Barry, Oct 08 2005

Keywords

Comments

The definition of a(0) is motivated by the idea that (anything)^n = 1 for n = 0. We also get this if "mod n" is replaced by "in Z/nZ", for n = 0. - M. F. Hasler, Nov 09 2018

Crossrefs

Cf. A015910.

Programs

  • Magma
    [2] cat [2^Modexp(2, n, n): n in [1..60]]; // Vincenzo Librandi, Nov 09 2018
  • Mathematica
    Join[{2}, 2^Table[PowerMod[2, n, n], {n, 85}]] (* Vincenzo Librandi, Nov 09 2018 *)
  • PARI
    apply( A112987(n)=2^lift(if(n,Mod(2,n))^n), [0..50]) \\ M. F. Hasler, Nov 09 2018
    

Formula

a(n) = 2^A015910(n) for n > 0. [Corrected by M. F. Hasler, Nov 09 2018]

Extensions

Name edited by M. F. Hasler, Nov 09 2018

A128092 a(n) = largest multiple of n which is <= 2^n.

Original entry on oeis.org

2, 4, 6, 16, 30, 60, 126, 256, 504, 1020, 2046, 4092, 8190, 16380, 32760, 65536, 131070, 262134, 524286, 1048560, 2097144, 4194300, 8388606, 16777200, 33554425, 67108860, 134217702, 268435440, 536870910, 1073741820, 2147483646
Offset: 1

Views

Author

Leroy Quet, Feb 14 2007

Keywords

Crossrefs

Programs

  • Maple
    a:=n->n*floor(2^n/n): seq(a(n),n=1..37); # Emeric Deutsch, Feb 16 2007
  • Mathematica
    f[n_] := n*Floor[2^n/n];Array[f, 33] (* Ray Chandler, Feb 19 2007 *)
  • Python
    def A128092(n): return (m:=1<Chai Wah Wu, Aug 24 2023

Formula

a(n) = n*floor(2^n/n) = n*A000799(n).
a(n) = 2^n - (2^n mod n). - Chai Wah Wu, Aug 24 2023

Extensions

Extended by Emeric Deutsch and Ray Chandler, Feb 19 2007

A215747 a(n) = (-2)^n mod n.

Original entry on oeis.org

0, 0, 1, 0, 3, 4, 5, 0, 1, 4, 9, 4, 11, 4, 7, 0, 15, 10, 17, 16, 13, 4, 21, 16, 18, 4, 1, 16, 27, 4, 29, 0, 25, 4, 17, 28, 35, 4, 31, 16, 39, 22, 41, 16, 28, 4, 45, 16, 19, 24, 43, 16, 51, 28, 12, 32, 49, 4, 57, 16, 59, 4, 55, 0, 33, 64, 65, 16, 61, 44, 69, 64, 71, 4, 7
Offset: 1

Views

Author

Alex Ratushnyak, Aug 23 2012

Keywords

Comments

n^(n+2) mod (n+2) is essentially the same.
Indices of 0's: 2^k - 1, k>=0.
Indices of 1's: A006521 except the first term.
Indices of 3's: A015940.
Indices of 5's: 7, 133, 1517, 11761, ...
a(A000040(n)) = A000040(n)-2 = A040976(n).

Examples

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

Crossrefs

Programs

  • Maple
    a:= n-> (-2)&^n mod n:
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 08 2015
  • Mathematica
    a[n_]:=Mod[(-2)^n ,n]; Array[a,75] (* Stefano Spezia, Aug 25 2025 *)
  • Python
    for n in range(1, 333):
        print((-2)**n % n, end=',')

A220235 a(n) = (2^n + 3^n) modulo n.

Original entry on oeis.org

0, 1, 2, 1, 0, 1, 5, 1, 8, 3, 5, 1, 5, 13, 5, 1, 5, 1, 5, 17, 14, 13, 5, 1, 0, 13, 26, 13, 5, 13, 5, 1, 2, 13, 30, 1, 5, 13, 35, 17, 5, 37, 5, 9, 35, 13, 5, 1, 12, 23, 35, 45, 5, 1, 0, 41, 35, 13, 5, 37, 5, 13, 35, 1, 15, 1, 5, 29, 35, 13, 5, 1, 5, 13, 50
Offset: 1

Views

Author

Zak Seidov, Dec 08 2012

Keywords

Comments

a(n) = (A015910(n) + A066601(n)) mod n.
a(n) = 0 at n = 1, 5, 25, 55, 125, 275, 605, 625, ... (A045576).

Crossrefs

Cf. A015910 (2^n mod n), A066601 (3^n mod n), A045576 (n|(2^n + 3^n)).

Programs

  • Mathematica
    Table[Mod[2^n + 3^n, n],{n,100}]

A294389 a(n) = 2^(n-3) mod n, for n >= 3.

Original entry on oeis.org

1, 2, 4, 2, 2, 0, 1, 8, 3, 8, 10, 4, 1, 0, 13, 8, 5, 12, 1, 6, 6, 8, 4, 20, 10, 16, 22, 8, 8, 0, 1, 26, 11, 8, 28, 10, 1, 32, 31, 8, 11, 24, 19, 12, 12, 32, 16, 28, 1, 28, 40, 44, 26, 32, 1, 44, 15, 32, 46, 16, 1, 0, 4, 8, 17, 36, 1, 58, 18, 8, 55, 56, 46, 40, 60, 8, 20, 32, 10, 62, 21, 8, 4, 22
Offset: 3

Views

Author

Enrique Navarrete, Oct 29 2017

Keywords

Comments

Every nonnegative integer seems to appear in the sequence, and every integer seems to appear in the sequence of first differences (see link).
For all 3 <= n < 10^9, a(n) != 7. - Robert G. Wilson v, Nov 30 2017

Crossrefs

Programs

  • Magma
    [Modexp(2,(n-3),n): n in [3..100]]; // G. C. Greubel, Jan 11 2023
    
  • Mathematica
    Array[PowerMod[2, # - 3, #] &, 80, 3] (* Robert G. Wilson v, Nov 30 2017 *)
  • SageMath
    [power_mod(2,(n-3),n) for n in range(3,101)] # G. C. Greubel, Jan 11 2023

Extensions

More terms from Robert G. Wilson v, Nov 30 2017

A015948 a(n) = smallest k >= n such that k | (2^k + n).

Original entry on oeis.org

1, 2, 5, 4, 7, 10, 15, 8, 11, 14, 13, 28, 21, 78, 17, 16, 19, 22, 49, 42, 23, 26, 1577, 40, 33, 30, 29, 44, 31, 34, 39, 32, 65, 38, 37, 52, 115, 102, 41, 242, 43, 46, 51, 60, 47, 279, 395, 152, 57, 114, 53, 68, 85, 58, 63, 104, 59, 62, 61, 76, 69, 126, 5773, 64, 67, 1090
Offset: 0

Views

Author

Keywords

Comments

Equally, a(n) = smallest k with 2^k mod k = k - n.

Crossrefs

Formula

a(p-2) = p for p prime >= 5; a(2^k) = 2^k. - David W. Wilson

Extensions

Edited by N. J. A. Sloane, Jan 31 2009 at the suggestion of R. J. Mathar and T. D. Noe.
Restricted the range of k in the definition - R. J. Mathar, Mar 07 2010

A073800 Remainder of division 2^n/c(n), where c(n)=A002808(n), the n-th composite.

Original entry on oeis.org

2, 4, 0, 7, 2, 4, 2, 1, 0, 16, 8, 1, 8, 16, 18, 16, 14, 8, 8, 0, 2, 30, 18, 28, 14, 4, 8, 16, 28, 19, 6, 16, 29, 34, 8, 40, 2, 14, 8, 16, 14, 4, 8, 4, 0, 49, 62, 52, 32, 4, 8, 46, 17, 20, 65, 22, 32, 16, 62, 64, 32, 64, 41, 16, 32, 64, 48, 70, 48, 24, 32, 22, 74, 84, 8, 16, 32, 52
Offset: 1

Views

Author

Labos Elemer, Aug 12 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Mod[2^j, FixedPoint[j+PrimePi[ # ]+1&, j]], {j, 1, 128}]
    Module[{c=Select[Range[200],CompositeQ],len},len=Length[c];Table[ PowerMod[ 2,n,c[[n]]],{n,len}]] (* Harvey P. Dale, Mar 03 2018 *)

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

Original entry on oeis.org

0, 1, 1, 1, 4, 4, 4, 1, 4, 6, 4, 4, 4, 2, 1, 1, 4, 16, 4, 16, 4, 16, 4, 16, 3, 16, 13, 16, 4, 16, 4, 1, 25, 16, 29, 16, 4, 16, 22, 16, 4, 16, 4, 20, 32, 16, 4, 16, 22, 16, 1, 16, 4, 52, 8, 32, 28, 16, 4, 16, 4, 16, 4, 1, 61, 16, 4, 52, 49, 46, 4, 16, 4, 16, 31, 24, 36, 16, 4, 16
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 14 2011

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Mod[2^(Mod[2^n, n]), n], {n, 50}] (* Alonso del Arte, Jan 14 2011 *)
    Table[PowerMod[2,PowerMod[2,n,n],n],{n,80}] (* Harvey P. Dale, Oct 09 2019 *)

Formula

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

Extensions

Entries corrected by R. J. Mathar, Jan 14 2011

A226221 Numbers n such that 2^n mod n is not a power of 2.

Original entry on oeis.org

1, 2, 4, 8, 16, 18, 25, 27, 32, 35, 36, 42, 45, 49, 50, 54, 55, 64, 70, 75, 77, 81, 88, 91, 95, 98, 99, 100, 104, 105, 108, 110, 115, 117, 119, 121, 125, 128, 130, 135, 136, 140, 143, 147, 150, 152, 153, 155, 156, 160, 161, 162, 169, 171, 175, 180, 184, 187, 189, 190, 198, 200
Offset: 1

Views

Author

Keywords

Comments

All terms beyond the first two are composite: this is a subsequence of A065090.

Examples

			2^18 = 262144 = 10 mod 18 and 10 is not a power of 2, so 18 is in the sequence.
		

Crossrefs

Programs

  • Maple
    isA226221 := proc(n)
        local m ;
        if n <= 2 then
            return true;
        end if;
        m := A015910(n) ;
        if type(m,'odd') or m = 0 then
            true;
        elif nops(numtheory[factorset](m))  >1 then
            true;
        else
            false;
        end if;
    end proc:
    A226221 := proc(n)
        local a;
        if n <= 2 then
            n;
        else
            for a from procname(n-1)+1 do
                if isA226221(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A226221(n),n=1..30) ; # R. J. Mathar, Jun 06 2013
  • Mathematica
    Select[Range[200],!IntegerQ[Log[2,PowerMod[2,#,#]]]&] (* Harvey P. Dale, Feb 28 2022 *)
  • PARI
    ispow2(n)=n>0 && n==1<
    				
Previous Showing 41-50 of 64 results. Next