cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A292375 a(1) = 1, and for n > 1, a(n) = a(A252463(n)) + [n == 1 (mod 4)].

This page as a plain text file.
%I A292375 #33 Apr 18 2025 13:03:13
%S A292375 1,1,1,1,2,1,2,1,2,2,2,1,3,2,1,1,4,2,4,2,3,2,4,1,3,3,1,2,5,1,5,1,3,4,
%T A292375 1,2,6,4,2,2,7,3,7,2,2,4,7,1,4,3,3,3,8,1,3,2,5,5,8,1,9,5,2,1,4,3,9,4,
%U A292375 5,1,9,2,10,6,2,4,2,2,10,2,2,7,10,3,3,7,4,2,11,2,3,4,6,7,3,1,12,4,2,3,13,3,13,3,2
%N A292375 a(1) = 1, and for n > 1, a(n) = a(A252463(n)) + [n == 1 (mod 4)].
%C A292375 For numbers > 1, iterate the map x -> A252463(x) which divides even numbers by 2, and shifts every prime in the prime factorization of odd n one index step towards smaller primes. a(n) counts the numbers of the form 4k+1 encountered until 1 has been reached, which is also included in the count. The count includes also n itself if it is of the form 4k+1 (A016813), thus a(1) = 1.
%C A292375 In other words, locate the node which contains n in binary tree A005940 and traverse from that node towards the root, counting all numbers of the form 4k+1 that occur on the path.
%H A292375 Antti Karttunen, <a href="/A292375/b292375.txt">Table of n, a(n) for n = 1..16384</a>
%H A292375 <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>
%F A292375 a(1) = 1, a(2n) = a(n), and for odd numbers n > 1, a(n) = a(A064989(n)) + [n == 1 (mod 4)].
%F A292375 a(n) = A000120(A292381(n)).
%F A292375 Other identities and observations. For n >= 1:
%F A292375 a(n) >= A292374(n).
%F A292375 a(A000040(n))-1 = A267097(n).
%F A292375 1 + A292377(n) - a(n) = A292378(n).
%F A292375 For n >= 2, a(n) + A292377(n) = A061395(n).
%F A292375 From _Antti Karttunen_, Apr 22 2022: (Start)
%F A292375 For n >= 2, a(n^2) = A061395(n). [Because A292377(n^2) = 0]
%F A292375 For n >= 1, a(A001248(n)) = n. [See comments in A292583]
%F A292375 (End)
%t A292375 a[1] = 1; a[n_] := a[n] = a[Which[n == 1, 1, EvenQ@n, n/2, True, Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ n]] + Boole[Mod[n, 4] == 1]; Array[a, 105] (* _Michael De Vlieger_, Sep 17 2017 *)
%o A292375 (PARI)
%o A292375 A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
%o A292375 A292375(n) = if(1==n,n,if(!(n%2),A292375(n/2),(if(1==(n%4),1,0)+A292375(A064989(n)))));
%o A292375 (Scheme)
%o A292375 ;; With memoization-macro definec.
%o A292375 (definec (A292375 n) (if (= 1 n) 1 (+ (if (= 1 (modulo n 4)) 1 0) (A292375 (A252463 n)))))
%Y A292375 Cf. A000120, A001248, A005940, A061395, A064989, A252463, A292374, A292377, A292378, A292381, A292583.
%K A292375 nonn
%O A292375 1,5
%A A292375 _Antti Karttunen_, Sep 17 2017