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.

A292243 a(1) = 1; for n > 1, a(n) = 3*a(A253889(n)) + (n mod 3).

This page as a plain text file.
%I A292243 #21 Jan 21 2025 14:28:28
%S A292243 1,5,3,16,17,9,49,11,33,160,50,156,52,53,147,88,29,27,82,149,474,457,
%T A292243 35,453,106,101,441,151,482,303,265,152,483,250,470,1449,1441,158,480,
%U A292243 1429,161,1407,469,443,1371,298,266,318,1348,89,969,961,83,954,910,248,897,268,449,1455,322,1424,99,808,1373,738,1366,107
%N A292243 a(1) = 1; for n > 1, a(n) = 3*a(A253889(n)) + (n mod 3).
%C A292243 a(n) encodes in its base-3 representation the succession of modulo 3 residues obtained when map x -> A253889(x), starting from x=n, is iterated down to the eventual 1.
%H A292243 Antti Karttunen, <a href="/A292243/b292243.txt">Table of n, a(n) for n = 1..16384</a>
%H A292243 <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>
%F A292243 a(1) = 1; for n > 1, a(n) = 3*a(A253889(n)) + A010872(n).
%t A292243 f[n_] := Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1]; g[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n; a[1] = 1; a[n_] := a[n] = 3 a[Floor@ g[Floor[f[n]/2]]] + Mod[n, 3]; Array[a, 68] (* _Michael De Vlieger_, Sep 16 2017 *)
%o A292243 (PARI)
%o A292243 A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From _Michel Marcus_
%o A292243 A048673(n) = (A003961(n)+1)/2;
%o A292243 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 A292243 A064216(n) = A064989((2*n)-1);
%o A292243 A253889(n) = if(1==n,n,A048673(A064216(n)\2));
%o A292243 A292243(n) = if(1==n,n,((n%3) + 3*A292243(A253889(n))));
%o A292243 (Scheme)
%o A292243 ;; With memoization-macro definec.
%o A292243 (definec (A292243 n) (if (= 1 n) n (+ (modulo n 3) (* 3 (A292243 (A253889 n))))))
%Y A292243 Cf. A010872, A048673, A064216, A253889, A292244, A292245, A292246.
%Y A292243 Cf. also A292384.
%K A292243 nonn,base
%O A292243 1,2
%A A292243 _Antti Karttunen_, Sep 15 2017