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.

A292374 a(1) = 1, a(2n) = 0, and for odd numbers n > 1, a(n) = a(A064989(n)) + [n == 1 (mod 4)].

This page as a plain text file.
%I A292374 #21 Apr 18 2025 13:03:19
%S A292374 1,0,0,0,1,0,1,0,1,0,1,0,2,0,0,0,3,0,3,0,1,0,3,0,2,0,0,0,4,0,4,0,1,0,
%T A292374 0,0,5,0,0,0,6,0,6,0,1,0,6,0,3,0,0,0,7,0,1,0,1,0,7,0,8,0,0,0,2,0,8,0,
%U A292374 1,0,8,0,9,0,0,0,1,0,9,0,1,0,9,0,1,0,0,0,10,0,1,0,1,0,0,0,11,0,0,0,12,0,12,0,1
%N A292374 a(1) = 1, a(2n) = 0, and for odd numbers n > 1, a(n) = a(A064989(n)) + [n == 1 (mod 4)].
%C A292374 For odd numbers > 1, iterate the map x -> A064989(x), which shifts every prime in the prime factorization of n one index step towards smaller primes. a(n) counts the numbers of the form 4k+1 encountered until the first number which is even has been reached. This count includes also n itself if it is of the form 4k+1 (A016813), thus a(1) = 1.
%C A292374 In other words, locate the position where n is in square array A246278 and moving up by that column, count all numbers of the form 4k+1 until an even number at the top of the column is reached.
%H A292374 Antti Karttunen, <a href="/A292374/b292374.txt">Table of n, a(n) for n = 1..16384</a>
%H A292374 <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>
%F A292374 a(1) = 1, a(2n) = 0, and for odd numbers n > 1, a(n) = a(A064989(n)) + [n == 1 (mod 4)].
%F A292374 a(n) <= A292375(n).
%F A292374 For n >= 2, a(n) + A292376(n) + 1 = A055396(n).
%t A292374 a[1] = 1; a[n_] := a[n] = If[EvenQ@ n, 0, a[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 A292374 (PARI)
%o A292374 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 A292374 A292374(n) = if(1==n,n,if(!(n%2),0,(if(1==(n%4),1,0)+A292374(A064989(n)))));
%o A292374 (Scheme)
%o A292374 ;; With memoization-macro definec.
%o A292374 (definec (A292374 n) (cond ((even? n) 0) ((= 1 n) 1) (else (+ (if (= 1 (modulo n 4)) 1 0) (A292374 (A064989 n))))))
%Y A292374 Cf. A016813, A055396, A064989, A246271, A246278, A292375.
%Y A292374 Cf. also A038802 (odd bisection of a(n) + A292376(n)).
%K A292374 nonn
%O A292374 1,13
%A A292374 _Antti Karttunen_, Sep 17 2017