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”).

A113778
Invert blocks of four in the sequence of natural numbers.
3
4, 3, 2, 1, 8, 7, 6, 5, 12, 11, 10, 9, 16, 15, 14, 13, 20, 19, 18, 17, 24, 23, 22, 21, 28, 27, 26, 25, 32, 31, 30, 29, 36, 35, 34, 33, 40, 39, 38, 37, 44, 43, 42, 41, 48, 47, 46, 45, 52, 51, 50, 49, 56, 55, 54, 53, 60, 59, 58, 57, 64, 63, 62, 61, 68, 67, 66
OFFSET
1,1
FORMULA
a(n) = k*floor((n+k-1)/k)-(n-1) mod k; k=4, n=1, 2, ...
a(n) = n-cos(n*pi)-2*sqrt(2)*cos((2*n+1)*pi/4). - Jaume Oliver Lafont, Dec 10 2008
G.f.: x*( 4-x-x^2-x^3+3*x^4 ) / ( (1+x)*(1+x^2)*(1-x)^2 ). - R. J. Mathar, Apr 02 2011
MATHEMATICA
With[{k=4}, Table[k Floor[(n+k-1)/k]-Mod[n-1, k], {n, 1, 10k}]]
Reverse/@Partition[Range[100], 4]//Flatten (* or *) LinearRecurrence[ {1, 0, 0, 1, -1}, {4, 3, 2, 1, 8}, 100] (* Harvey P. Dale, Mar 02 2020 *)
CROSSREFS
Cf. A113655.
Sequence in context: A194750 A370350 A194743 * A295673 A155172 A253902
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Jan 20 2006
EXTENSIONS
More terms from Harvey P. Dale, Mar 02 2020
STATUS
approved