|
|
A230089
|
|
If n is divisible by 4 then 4, if n is divisible by 2 then 2, otherwise n.
|
|
1
|
|
|
1, 2, 3, 4, 5, 2, 7, 4, 9, 2, 11, 4, 13, 2, 15, 4, 17, 2, 19, 4, 21, 2, 23, 4, 25, 2, 27, 4, 29, 2, 31, 4, 33, 2, 35, 4, 37, 2, 39, 4, 41, 2, 43, 4, 45, 2, 47, 4, 49, 2, 51, 4, 53, 2, 55, 4, 57, 2, 59, 4, 61, 2, 63, 4, 65, 2, 67, 4, 69, 2, 71, 4, 73, 2, 75, 4, 77, 2, 79, 4, 81, 2, 83, 4, 85, 2, 87, 4, 89, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Suggested by a puzzle in Mitteilungen der DMV, although I do not know if this solution is what they had in mind.
|
|
REFERENCES
|
Frank Lutz and Brigitte Lutz-Westphal, Eigenwillige Zahlen, Mitteilungen der DMV, 2013, Band 21, Heft 1 (p. 32).
|
|
LINKS
|
|
|
FORMULA
|
Conjecture: a(n) = (3+3*(-1)^n+(-i)^n+i^n+n-(-1)^n*n)/2 where i=sqrt(-1). G.f.: -x*(4*x^5-x^4-2*x^3-2*x^2-2*x-1) / ((x-1)^2*(x+1)^2*(x^2+1)). - Colin Barker, Oct 09 2013
|
|
MAPLE
|
f:=proc(n) if (n mod 4) = 0 then 4 elif (n mod 4) = 2 then 2; else n; fi; end;
|
|
MATHEMATICA
|
Table[Which[Divisible[n, 4], 4, Divisible[n, 2], 2, True, n], {n, 100}] (* or *) LinearRecurrence[{0, 1, 0, 1, 0, -1}, {1, 2, 3, 4, 5, 2}, 100] (* Harvey P. Dale, Dec 03 2017 *)
|
|
PROG
|
(Haskell)
a230089 n = if odd n then n else if mod n 4 == 0 then 4 else 2
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|