OFFSET
1,91
COMMENTS
The first instance of a(n)=2 is for n=91; the first instance of a(n)=3 is for n=1729. 1729 is famously Ramanujan's taxi cab number -- see A001235. - Harvey P. Dale, Jun 25 2013
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
S. R. Finch and Pascal Sebah, Squares and Cubes Modulo n, arXiv:math/0604465 [math.NT], 2006-2016.
FORMULA
MAPLE
A005088 := proc(n)
local a, pe;
a := 0 ;
for pe in ifactors(n)[2] do
if modp(op(1, pe), 3)= 1 then
a := a+1 ;
end if;
end do:
a ;
end proc: # R. J. Mathar, May 19 2020
MATHEMATICA
Join[{0}, Table[Count[Transpose[FactorInteger[n]][[1]], _?(Mod[#-1, 3] == 0&)], {n, 2, 100}]] (* Harvey P. Dale, Sep 22 2021 *)
Array[DivisorSum[#, 1 &, And[PrimeQ@ #, Mod[#, 3] == 1] &] &, 91] (* Michael De Vlieger, Jul 11 2017 *)
PROG
(PARI) a(n)=my(f=factor(n)[, 1]); sum(i=1, #f, f[i]%3==1) \\ Charles R Greathouse IV, Jan 16 2017
(Scheme) (define (A005088 n) (if (= 1 n) 0 (+ (modulo (modulo (A020639 n) 3) 2) (A005088 (A028234 n))))) ;; Antti Karttunen, Jul 10 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved