login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of parts if 3^n is partitioned into parts of size 2^n as far as possible and into parts of size 1^n.
12

%I #50 Jan 22 2018 07:11:29

%S 2,3,6,6,26,36,28,186,265,738,1105,3186,5269,15516,29728,55761,35228,

%T 235278,441475,272526,1861166,3478866,6231073,1899171,5672262,

%U 50533341,17325482,186108951,21328109,63792576,1264831925,3794064336,7086578554

%N Number of parts if 3^n is partitioned into parts of size 2^n as far as possible and into parts of size 1^n.

%C Corresponds to the only solution of the Diophantine equation 3^n = x*2^n + y*1^n with constraint 0 <= y < 2^n. [Since 3^n is odd, of course y cannot be zero.)

%H Iain Fox, <a href="/A060692/b060692.txt">Table of n, a(n) for n = 1..3322</a> (first 500 terms from Harry J. Smith)

%F a(n) = A002379(n) + A002380(n) = floor(3^n/2^n) + (3^n mod 2^n).

%F For n > 2, a(n) = 3^n mod (2^n-1). [_Alex Ratushnyak_, Jul 22 2012]

%e 3^4 = 81 = 16 + 16 + 16 + 16 + 16 + 1, so a(4) = 5 + 1 = 6;

%e 3^5 = 243 = 32 + 32 + 32 + 32 + 32 + 32 + 32 + 19*1, so a(5) = 7 + 19 = 26.

%t Table[3^n - (-1 + 2^n) Floor[(3/2)^n], {n, 33}] (* _Fred Daniel Kline_, Nov 01 2017 *)

%t x[n_] := -(1/2) + (3/2)^n + ArcTan[Cot[(3/2)^n Pi]]/Pi;

%t y[n_] := 3^n - 2^n * x[n]; yplusx[n_] := y[n] + x[n];

%t Array[yplusx, 33] (* _Fred Daniel Kline_, Dec 21 2017 *)

%t f[n_] := Floor[3^n/2^n] + PowerMod[3, n, 2^n]; Array[f, 33] (* _Robert G. Wilson v_, Dec 27 2017 *)

%o (PARI) {for(n=1,33,d=divrem(3^n,2^n); print1(d[1]+d[2],","))}

%o (PARI) { for (n=1, 500, write("b060692.txt", n, " ", floor(3^n/2^n) + (3^n%2^n)); ) } \\ _Harry J. Smith_, Jul 09 2009

%o (Haskell)

%o a060692 n = uncurry (+) $ divMod (3 ^ n) (2 ^ n)

%o -- _Reinhard Zumkeller_, Jul 11 2014

%Y Cf. A002379, A002380, A064464, A064630.

%Y Cf. A000079, A000244.

%K nonn

%O 1,1

%A _Labos Elemer_, Apr 20 2001

%E Edited by _Klaus Brockhaus_, May 24 2003