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).
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
Keywords
Links
- Muniru A Asiru, Table of n, a(n) for n = 1..3280
- Fred Daniel Kline and Mariusz Iwaniuk, Is this a closed form?, Mathematica StackExchange, 2017.
- Wikipedia, Waring's problem
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
Comments