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.

A269848 a(1) = 1, a(2n) = A065090(1+a(n)), a(2n+1) = A000040(a(A064989(2n+1))).

This page as a plain text file.
%I A269848 #19 Apr 26 2025 15:27:15
%S A269848 1,2,3,4,5,6,11,8,7,9,31,10,127,18,13,14,709,12,5381,15,23,45,52711,
%T A269848 16,17,165,19,27,648391,21,9737333,22,61,856,41,20,174440041,6185,197,
%U A269848 24,3657500101,34,88362852307,63,29,58644,2428095424619,25,59,26,977,212
%N A269848 a(1) = 1, a(2n) = A065090(1+a(n)), a(2n+1) = A000040(a(A064989(2n+1))).
%C A269848 Term a(47) manually copied from A007097(15). Note that A000040(15) = 47.
%H A269848 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A269848 a(1) = 1, a(2) = 2, for n > 2, if n is even, a(n) = A002808(a(n/2)-1), and for odd n, a(n) = A000040(a(A064989(n))).
%F A269848 As a composition of other permutations:
%F A269848 a(n) = A237739(A243071(n)).
%F A269848 Other identities. For all n >= 1:
%F A269848 a(A000040(n)) = A007097(n). [Maps primes to the primeth recurrence.]
%o A269848 (PARI)
%o A269848 allocatemem(2^30);
%o A269848 default(primelimit,4294965247);
%o A269848 A002808(n) = { my(k=-1); while( -n + n += -k + k=primepi(n), ); n}; \\ This function from _M. F. Hasler_
%o A269848 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 A269848 A269848 = n -> if(n<=2,n,if((n%2),prime(A269848(A064989(n))),A002808(A269848(n/2)-1)));
%o A269848 for(n=1, 52, t = A269848(n); print1(t,", "); write("b269848.txt", n, " ", t));
%o A269848 (Scheme)
%o A269848 ;; With memoization-macro definec.
%o A269848 (definec (A269848 n) (cond ((<= n 1) n) ((even? n) (A065090 (+ 1 (A269848 (/ n 2))))) (else (A000040 (A269848 (A064989 n))))))
%Y A269848 Inverse: A269847.
%Y A269848 Cf. A000040, A007097, A002808, A064989, A065090.
%Y A269848 Related or similar permutations: A237739, A243071, A246682, A269858.
%K A269848 nonn
%O A269848 1,2
%A A269848 _Antti Karttunen_, Mar 06 2016