A209636 Matula-numbers computed for rooted trees encoded by A071162/A071163.
1, 2, 4, 3, 8, 6, 7, 5, 16, 12, 14, 10, 19, 13, 17, 11, 32, 24, 28, 20, 38, 26, 34, 22, 53, 37, 43, 29, 67, 41, 59, 31, 64, 48, 56, 40, 76, 52, 68, 44, 106, 74, 86, 58, 134, 82, 118, 62, 131, 89, 107, 71, 163, 101, 139, 79, 241, 157, 191, 109, 331, 179, 277
Offset: 0
Links
- Indranil Ghosh (terms 0..1000) & Antti Karttunen, Table of n, a(n) for n = 0..8191
- Index entries for sequences related to binary expansion of n
- Index entries for sequences related to Matula-Goebel numbers
Programs
-
PARI
A209636(n) = { my(n=2*n, m=1); while(n >= 2, if(!(n%2),m*=2,m = prime(m)); n\=2); m; } \\ Antti Karttunen, May 25 2017
-
Python
from sympy import prime def a(n): n = 2*n m = 1 if n<2: return 1 while n>1: if n%2==0: n//=2 m*=2 else: n=(n - 1)//2 m=prime(m) return m print([a(n) for n in range(101)]) # Indranil Ghosh, May 25 2017, translated from Antti Karttunen's SCHEME code
-
Scheme
(define (A209636 n) (let loop ((n (* 2 n)) (m 1)) (cond ((< n 2) m) ((even? n) (loop (/ n 2) (* m 2))) (else (loop (/ (- n 1) 2) (A000040 m))))))
Comments