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.

A260442 Sequence A260443 sorted into ascending order.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 11, 13, 15, 17, 18, 19, 23, 29, 30, 31, 35, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 75, 77, 79, 83, 89, 90, 97, 101, 103, 105, 107, 109, 113, 127, 131, 137, 139, 143, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 210, 211, 221, 223, 227, 229, 233, 239, 241, 245, 251, 257, 263, 269, 270, 271, 277, 281, 283, 293, 307, 311
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2015

Keywords

Comments

Each term is a prime factorization encoding of one of the Stern polynomials. See A260443 for details.
Numbers n for which A260443(A048675(n)) = n. - Antti Karttunen, Oct 14 2016

Crossrefs

Subsequence of A073491.
From 2 onward the positions of nonzeros in A277333.
Various subsequences: A000040, A002110, A070826, A277317, A277200 (even terms). Also all terms of A277318 are included here.
Cf. also A277323, A277324 and permutation pair A277415 & A277416.

Programs

  • PARI
    allocatemem(2^30);
    A048675(n) = my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; \\ Michel Marcus, Oct 10 2016
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From Michel Marcus
    A260443(n) = if(n<2, n+1, if(n%2, A260443(n\2)*A260443(n\2+1), A003961(A260443(n\2))));
    isA260442(n) = (A260443(A048675(n)) == n);  \\ The most naive version.
    A055396(n) = if(n==1, 0, primepi(factor(n)[1, 1])) \\ Charles R Greathouse IV, Apr 23 2015
    A061395(n) =  if(1==n, 0, primepi(vecmax(factor(n)[, 1]))); \\ After M. F. Hasler's code for A006530.
    isA260442(n) = ((1==n) || isprime(n) || ((omega(n) == 1+(A061395(n)-A055396(n))) && (A260443(A048675(n)) == n))); \\ Somewhat optimized.
    i=0; n=0; while(i < 10001, n++; if(isA260442(n), write("b260442.txt", i, " ", n); i++));
    \\ Antti Karttunen, Oct 14 2016
    
  • Python
    from sympy import factorint, prime, primepi
    from operator import mul
    from functools import reduce
    def a048675(n):
        F=factorint(n)
        return 0 if n==1 else sum([F[i]*2**(primepi(i) - 1) for i in F])
    def a003961(n):
        F=factorint(n)
        return 1 if n==1 else reduce(mul, [prime(primepi(i) + 1)**F[i] for i in F])
    def a(n): return n + 1 if n<2 else a003961(a(n//2)) if n%2==0 else a((n - 1)//2)*a((n + 1)//2)
    print([n for n in range(301) if a(a048675(n))==n]) # Indranil Ghosh, Jun 21 2017
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A260442 (FIXED-POINTS 0 1 (COMPOSE A260443 A048675)))
    ;; An optimized version:
    (define A260442 (MATCHING-POS 0 1 (lambda (n) (or (= 1 n) (= 1 (A010051 n)) (and (not (< (A001221 n) (+ 1 (A243055 n)))) (= n (A260443 (A048675 n))))))))
    ;; Antti Karttunen, Oct 14 2016