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.

A285111 Permutation of nonnegative integers: a(1) = 0, a(2) = 1, a(A005117(1+n)) = 2*a(n), a(A065642(n)) = 1 + 2*a(n).

This page as a plain text file.
%I A285111 #14 Apr 30 2021 12:39:38
%S A285111 0,1,2,3,4,6,8,7,5,12,16,13,14,10,24,15,32,27,26,25,28,20,48,55,9,30,
%T A285111 11,21,64,54,52,31,50,56,40,111,96,110,18,51,60,22,42,41,49,128,108,
%U A285111 223,17,103,104,61,62,447,100,43,112,80,222,109,192,220,57,63,36,102,120,113,44,84,82,895,98,256,99,221,216,446,34,207,23
%N A285111 Permutation of nonnegative integers: a(1) = 0, a(2) = 1, a(A005117(1+n)) = 2*a(n), a(A065642(n)) = 1 + 2*a(n).
%C A285111 Note the indexing: the domain starts from 1, while the range includes also zero.
%H A285111 Antti Karttunen, <a href="/A285111/b285111.txt">Table of n, a(n) for n = 1..10000</a>
%H A285111 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A285111 a(1) = 0, a(2) = 1, and for n > 2, if A008683(n) <> 0 [when n is squarefree], a(n) = 2*a(A013928(n)), otherwise a(n) = 1 + 2*a(A285328(n)).
%o A285111 (Scheme, with memoization-macro definec)
%o A285111 (definec (A285111 n) (cond ((<= n 2) (- n 1)) ((not (zero? (A008683 n))) (* 2 (A285111 (A013928 n)))) (else (+ 1 (* 2 (A285111 (A285328 n)))))))
%o A285111 (Python)
%o A285111 from operator import mul
%o A285111 from sympy import primefactors
%o A285111 from sympy.ntheory.factor_ import core
%o A285111 from functools import reduce
%o A285111 def a007947(n): return 1 if n<2 else reduce(mul, primefactors(n))
%o A285111 def a285328(n):
%o A285111     if core(n) == n: return 1
%o A285111     k=n - 1
%o A285111     while k>0:
%o A285111         if a007947(k) == a007947(n): return k
%o A285111         else: k-=1
%o A285111 def a013928(n): return sum([1 for i in range(1, n) if core(i) == i])
%o A285111 def a(n):
%o A285111     if n<3: return n - 1
%o A285111     if core(n)==n: return 2*a(a013928(n))
%o A285111     else: return 1 + 2*a(a285328(n))
%o A285111 print([a(n) for n in range(1, 121)]) # _Indranil Ghosh_, Apr 17 2017
%Y A285111 Inverse: A285112.
%Y A285111 Cf. A005117, A008683, A013928, A065642, A285328.
%Y A285111 Similar or related permutations: A243343, A243345, A277695, A284571.
%K A285111 nonn
%O A285111 1,3
%A A285111 _Antti Karttunen_, Apr 17 2017