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 11-20 of 22 results. Next

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

Original entry on oeis.org

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

Views

Author

Paul D. Hanna, Dec 03 2015

Keywords

Examples

			z = 0.75594020448010606647144106804060047816870395163968\
72304532627156633058912562881048650646517497629698\
33169849358914054511745177703214166923291737026705\
91492943241880014319515193043639253737676423992852\
25627848946162966420904437623290023301210538408167\
32840100004038800021575413579911936230620097811725\
74486975449203289931795206458185235457647073997267\
67563061259503400805979249157888064546156321001516\
17847448155223110095055233059421134812069600436905\
60954415853832952945591153477408523323724465192975...
INFINITE SERIES.
z = 1/3 + 1/3^2 + 3/3^3 + 1/3^4 + 19/3^5 + 25/3^6 + 11/3^7 + 161/3^8 + 227/3^9 + 681/3^10 + 1019/3^11 + 3057/3^12 + 5075/3^13 + 15225/3^14 + 29291/3^15+ 55105/3^16 + 34243/3^17 + 233801/3^18 + 439259/3^19 + 269201/3^20 +...+ A002380(n)/3^n +...
		

Crossrefs

Cf. A002380 (3^n mod 2^n), A264918, A264920, A264921, A264922.

Formula

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

A064536 a(n) = (4^n mod 3^n) mod 2^n.

Original entry on oeis.org

1, 3, 2, 13, 20, 3, 51, 87, 121, 711, 1139, 3537, 8034, 15752, 27922, 49629, 33201, 35975, 143900, 136341, 545364, 2181456, 1060135, 4240540, 16962160, 28647197, 13597858, 205877827, 100616667, 381266393, 1397863922, 3825576990, 8216376565, 14181633879, 22366797148
Offset: 1

Views

Author

Labos Elemer, Oct 08 2001

Keywords

Comments

A generalization of A002380. It arises also as a coefficient (=c1) of 1^n=1 in a special (greedy) decomposition of 4^n into like powers as follows: 4^n = c3*3^n + c2*2^n + c1*1^n.

Crossrefs

Programs

  • Mathematica
    Table[Mod[PowerMod[4,n,3^n],2^n],{n,40}] (* Harvey P. Dale, Apr 09 2013 *)
  • PARI
    a(n) = { (4^n % 3^n) % 2^n } \\ Harry J. Smith, Sep 17 2009

Formula

n = 7: 4^7 = 16384 = 7*2187 + 8*128 + 51*1 where a(7)=51, the last coefficient; A064630(7) = 7 + 8 + a(7) = 66.

A064631 a(n) = ceiling(log_2(A064630(n))).

Original entry on oeis.org

2, 3, 3, 5, 5, 4, 7, 7, 8, 10, 11, 12, 13, 14, 15, 16, 16, 16, 18, 18, 20, 22, 21, 23, 25, 25, 24, 28, 27, 29, 31, 32, 33, 34, 35, 36, 37, 37, 39, 40, 39, 42, 42, 44, 44, 46, 46, 46, 49, 50, 51, 51, 51, 54, 55, 55, 57, 57, 59, 60, 60, 61, 63, 64, 64, 66, 60, 62, 67, 70, 69, 72
Offset: 1

Views

Author

Labos Elemer, Oct 01 2001

Keywords

Comments

In A064630, using a greedy algorithm we write 4^n = x*3^n+y*2^n+z*1^n and A064630(n) = x+y+z. This sequence is a measure of the "length" or complexity of those solutions.

Crossrefs

Formula

a(n) = A029837(A064630(n)) = ceiling(log_2(A064630(n))).

Extensions

Initial terms corrected and entry revised by Sean A. Irvine, Jul 18 2023

A064855 a(n) = (((6^n mod 5^n) mod 4^n) mod 3^n) mod 2^n.

Original entry on oeis.org

1, 2, 0, 14, 16, 10, 66, 21, 321, 917, 2037, 1550, 2420, 15152, 27439, 46731, 110953, 137148, 336949, 703202, 805647, 181132, 5835407, 3343039, 21816283, 18528238, 95129681, 241918238, 311938330, 48698222, 1539688558, 3481498150, 8104918325, 13512884439, 22365723609
Offset: 1

Views

Author

Labos Elemer, Oct 08 2001

Keywords

Comments

A generalization of A002380, A064536 and A064854. It arises also as a coefficient (=c1) of 1^n=1 in a special (greedy) decomposition of 6^n into like powers as follows: 6^n = c5*5^n + c4*4^n + c3*3^n + c2*2^n + c1*1^n.

Crossrefs

Programs

  • Mathematica
    Table[Fold[Mod,6^n,Range[5,2,-1]^n],{n,40}]  (* Harvey P. Dale, Mar 14 2011 *)
  • PARI
    a(n) = { (((6^n%5^n)%4^n)%3^n)%2^n } \\ Harry J. Smith, Sep 28 2009

Formula

n = 8: 6^8 = 1679616 = 4*390625 + 1*65536 + 7*6561 + 22*256 + 21*1 where a(8)=21, the last coefficient and here 6^8 is decomposed into 4 + 1 + 7 + 22 + 21 = 55 like (8th) powers.

A178985 Primes of the form 3^k mod 2^k, in the order in which they are found.

Original entry on oeis.org

3, 19, 11, 227, 1019, 269201, 186023729, 457933343698297657, 2267602862220213494836920572800947269169358383491, 3510117420185552058703020362961660520827436011216742688744177
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 03 2011

Keywords

Comments

Can it be shown that this is always an increasing sequence?
{a(n)} is an increasing sequence because {a(n)} is a subsequence of the integer sequence {b(n)} = (fractional part of (3/2)^n without the decimal point)/5^n = A204544(n) / 5^n = prime terms of A002380. - Michel Lagneau, Jan 25 2012
Corresponding n: 3, 5, 7, 9, 11, 20, 28, 62, 161, 204, 471, 505, 881, 1810, 1812, 2506, 3321, ... - Eric Chen, Jun 13 2018

Crossrefs

Programs

  • Mathematica
    f[n_] := PowerMod[3, n, 2^n]; Select[f@ Range@ 300, PrimeQ]

A064854 a(n) = ((5^n mod 4^n) mod 3^n) mod 2^n.

Original entry on oeis.org

1, 0, 7, 0, 21, 37, 118, 56, 19, 428, 808, 3920, 2256, 15240, 28312, 46733, 128931, 251439, 434788, 645833, 1397733, 1179155, 7185704, 1551886, 33308648, 65879944, 121274199, 65829274, 228529703, 248939750, 799831532, 2835988891, 1358930753, 9419331043, 9093076436
Offset: 1

Views

Author

Labos Elemer, Oct 08 2001

Keywords

Comments

A generalization of A002380 and A064536. It arises also as a coefficient (=c1) of 1^n=1 in a special (greedy) decomposition of 5^n into like powers as follows: 5^n = c4*4^n + c3*3^n + c2*2^n + c1*1^n.

Crossrefs

Programs

Formula

n = 7: 5^7 = 78125 = 4*16384 + 5*2187 + 12*128 + 118*1, where a(7)=118, the last coefficient.

A262207 a(n) = prime(n)^n mod n^n.

Original entry on oeis.org

0, 1, 17, 97, 1676, 21241, 214259, 5020449, 34808102, 7233300201, 46070142226, 7806783217105, 165239209697109, 1608006723911113, 48560388990668468, 4867006141797699265, 530779430908845468654, 18442832496573633213385
Offset: 1

Views

Author

Altug Alkan, Sep 15 2015

Keywords

Comments

Inspired by A002380, A067602, A138654.
a(3), a(4), a(7) and a(48) are prime numbers.
There are no further prime numbers up to a(1000). - Harvey P. Dale, Jun 15 2025

Examples

			For n = 1, a(n) = prime(1)^1 mod 1^1 = 2^1 mod 1 = 2 mod 1 = 0.
For n = 2, a(n) = prime(2)^2 mod 2^2 = 3^2 mod 4 = 9 mod 4 = 1.
For n = 3, a(n) = prime(3)^3 mod 3^3 = 5^3 mod 27 = 125 mod 27 = 17.
		

Crossrefs

Programs

  • Mathematica
    Table[Mod[Prime[n]^n, n^n], {n, 18}] (* Michael De Vlieger, Sep 15 2015 *)
    Table[PowerMod[Prime[n],n,n^n],{n,20}] (* Harvey P. Dale, Jun 15 2025 *)
  • PARI
    a(n) = (prime(n)^n) % (n^n);
    vector(18, n, a(n))

Formula

a(n) = A062457(n) mod A000312(n). - Michel Marcus, Sep 15 2015

A297446 a(1) = 1; a(n) = (2^n - 1)*((3^n - 1)/(2^n - 1) mod 1), n >= 2. Unreduced numerators of fractional parts of (3^n - 1)/(2^n - 1).

Original entry on oeis.org

1, 2, 5, 5, 25, 35, 27, 185, 264, 737, 1104, 3185, 5268, 15515, 29727, 55760, 35227, 235277, 441474, 272525, 1861165, 3478865, 6231072, 1899170, 5672261, 50533340, 17325481, 186108950, 21328108, 63792575, 1264831924, 3794064335, 7086578553
Offset: 1

Views

Author

Fred Daniel Kline, Dec 30 2017

Keywords

Comments

An easy way to get the numerator of the fractional part of the proper fraction (3/2)^n is (3^n - 2^n) (mod 2^n), which is not considered an elementary function. So, we created a function that subtracted the denominator from this difference until we got a sign change from positive to negative. I asked if this might be considered elementary at the Kline-Iwaniuk link. Mariusz Iwaniuk noticed the similarity to the sawtooth wave, and crafted a closed form for the floor of (3/2)^n from which we can get the modulus value for the numerator.
A back-of-the-envelope proof sketch of Waring's Problem.
We start with the original Diophantine equation from A060692, which we designate as x(n)+y(n), and substitute it into the "if statement" from Wikipedia Waring's Problem link: "if x(n) + y(n) <= 2^n." This has had no proof because we need more information.
So we extend the expression to three variables, (x,y,z), with z as the numerator of the fractional part of (3^n-1)/(2^n-1), and add the restriction that x is the common floor of (3^n - 1) / (2^n - 1) and 3^n / 2^n.
We find an identity for n >= 2, x(n) + y(n) == z(n) + 1, and substitute it into the if statement: "if x(n) + y(n) == z(n) + 1 <= 2^n."
Since the numerator of the fractional part must be within the bounds, 1 < z < 2^n -1, we determine that the greatest possible value of z is 2^n -2. Substituting for z(n), "if 2^n - 2 + 1 <= 2^n," shows it is always True. And more importantly, the Diophantine equation is always less than 2^n.
Inspection of z[1] shows it is also always True, with and without the anomaly. So, Waring is shown for n >= 1.

Crossrefs

Programs

  • GAP
    Concatenation([1],List([2..35],n->(3^n-1) mod (2^n-1))); # Muniru A Asiru, Dec 19 2018
    
  • Magma
    [1] cat [(3^n-1) mod (2^n -1): n in [2..30]]; // G. C. Greubel, Dec 16 2018
    
  • Maple
    a:=n->`if`(n=1,1,modp(3^n-1,2^n-1)): seq(a(n),n=1..35); # Muniru A Asiru, Dec 19 2018
  • Mathematica
    x[n_] := -(1/2) + (3/2)^n + ArcTan[Cot[(3/2)^n Pi]]/Pi;
    y[n_] := 3^n - 2^n * x[n];
    z[n_] := x[n] + y[n] - 1;
    Array[z, {33}]
    f[n_] := PowerMod[3, n, 2^n -1] -1; f[1] = 1; f[2] = 2; Array[f, 33] (* Robert G. Wilson v, Jan 05 2018 *)
  • PARI
    a(n) = if (n==1, 1, (3^n-1) % (2^n-1)); \\ Michel Marcus, Jan 02 2018
    
  • Python
    def A297446(n): return pow(3,n,(1<2 else n # Chai Wah Wu, Jun 25 2024
  • Sage
    [1] + [mod(3^n-1, 2^n-1) for n in (2..30)] # G. C. Greubel, Dec 16 2018
    

Formula

a(1) = 1; a(n) = (2^n - 1)*((3^n - 1)/(2^n - 1) mod 1), n >= 2, is the conventional way to describe the sequence. z(n) is the closed form which includes the anomaly.
a(n) = z(n).
x(n) := (3/2)^n + ( tan^-1 ( cot( Pi * (3/2)^n ) ) ) / Pi - 1/2;
y(n) := 3^n - 2^n * x(n);
z(n) := x(n) + y(n) - 1.
a(n) = A060692(n) - 1. - Fred Daniel Kline, Dec 13 2018

A065622 Numerator of 1 - (3/4)^n - frac((3/2)^n), where frac(x) = x - floor(x).

Original entry on oeis.org

0, -1, 3, 13, 159, 173, 1767, 12789, 17759, 126237, 292183, 1930245, 3724303, 23940141, 14206087, 99585429, 640559295, 12562430525, 7042526903, 43417422885, 813747135599, 494896655693, 3000760993767, 18098709141429, 249612172740383
Offset: 0

Views

Author

Henry Bottomley, Dec 03 2001

Keywords

Comments

The presumption that the fraction is positive for n > 1 underlies the presumed solution to Waring's problem.

Examples

			a(3) = 13 since 1 - (3/4)^3 - frac((3/2)^3) = 1 - 27/64 - frac(27/8) = 1 - 27/64 - 3/8 = (64 - 27 - 24)/64 = 13/64.
		

Crossrefs

Denominator is A000302. Cf. A002804.

Programs

  • Mathematica
    Table[1 - (3/4)^n - FractionalPart[(3/2)^n], {n, 0, 24}] // Numerator (* Jean-François Alcover, Apr 26 2016 *)
  • PARI
    { for (n=0, 200, a=numerator(1 - (3/4)^n - frac((3/2)^n)); write("b065622.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 24 2009

Formula

a(n) = 4^n*(1 + floor((3/2)^n)) - 3^n - 6^n = A005061(n) - A002380(n)*A000079(n) = A000302(n)*(1 + A002379(n)) - A000244(n) - A000400(n).

A178995 Numbers k such that 3^k (mod 2^k) is prime.

Original entry on oeis.org

3, 5, 7, 9, 11, 20, 28, 62, 161, 204, 471, 505, 881, 1810, 1812, 2506, 3321, 6809, 9272, 15131, 17449, 25250, 27989, 36082, 53309, 64970, 66354, 69646, 96080, 176059, 451810, 549633
Offset: 1

Views

Author

Robert G. Wilson v, Jan 03 2011

Keywords

Crossrefs

Programs

  • Mathematica
    fQ[n_] := PrimeQ@ PowerMod[3, n, 2^n]; k = 1; lst = {}; While[k < 15001, If[fQ@ k, AppendTo[lst, k]]; k++]; lst
  • PARI
    for(n=1, 10^5, if(ispseudoprime((3^n)%(2^n)), print1(n, ", "))) \\ Felix Fröhlich, Jun 05 2014

Formula

A002380(a(n)) = A178985(n). - Amiram Eldar, Jul 18 2021

Extensions

a(20)-a(23) from Felix Fröhlich, Jun 06 2014
a(24)-a(28) from Amiram Eldar, Jul 18 2021
a(29) from Michael S. Branicky, Jun 08 2024
a(30)-a(32) from Henri Lifchitz, Jun 05 2025
Previous Showing 11-20 of 22 results. Next