login
Compound filter: a(n) = 4*A032742(n) + (n mod 4), a(1) = 1.
7

%I #9 May 12 2017 18:21:28

%S 1,6,7,8,5,14,7,16,13,22,7,24,5,30,23,32,5,38,7,40,29,46,7,48,21,54,

%T 39,56,5,62,7,64,45,70,31,72,5,78,55,80,5,86,7,88,61,94,7,96,29,102,

%U 71,104,5,110,47,112,77,118,7,120,5,126,87,128,53,134,7,136,93,142,7,144,5,150,103,152,45,158,7,160,109,166,7,168,69,174,119,176,5,182,55

%N Compound filter: a(n) = 4*A032742(n) + (n mod 4), a(1) = 1.

%H Antti Karttunen, <a href="/A286474/b286474.txt">Table of n, a(n) for n = 1..10000</a>

%F a(1) = 1, for n > 1, a(n) = 4*A032742(n) + (n mod 4).

%t Table[If[n == 1, 1, 4 (Divisors[n][[-2]]) + Mod[n, 4]], {n, 91}] (* _Michael De Vlieger_, May 12 2017 *)

%o (Scheme) (define (A286474 n) (if (= 1 n) n (+ (* 4 (A032742 n)) (modulo n 4))))

%o (Python)

%o from sympy import divisors, primefactors

%o def a(n): return 1 if n==1 else 4*divisors(n)[-2] + n%4 # _Indranil Ghosh_, May 12 2017

%Y Cf. A032742, A285729, A286472, A286473, A286475, A286476.

%K nonn

%O 1,2

%A _Antti Karttunen_, May 11 2017