OFFSET
1,3
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from David W. Wilson)
FORMULA
a(n) = valuation(3*n, 9) + A007740(n). - Amiram Eldar, Aug 25 2024
EXAMPLE
Take the sequence 1, 9, 81, 729, ... and reduce mod n; count distinct terms. For n = 5 we get 1, 4, 1, 4, ... so a(5) = 2.
MATHEMATICA
With[{p9=9^Range[0, 50]}, Table[Length[Union[Mod[#, n]&/@p9]], {n, 100}]] (* Harvey P. Dale, Apr 22 2012 *)
a[n_] := IntegerExponent[3*n, 9] + MultiplicativeOrder[9, n/3^IntegerExponent[n, 3]]; Array[a, 100] (* Amiram Eldar, Aug 25 2024 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Henry Bottomley, Apr 20 2000
STATUS
approved