A359036 a(1) = 1. Thereafter a(n) is the least unused k distinct from n such that d(k) = d(n), where d is the divisor counting function, A000005.
1, 3, 2, 9, 7, 8, 5, 6, 4, 14, 13, 18, 11, 10, 21, 81, 19, 12, 17, 28, 15, 26, 29, 30, 49, 22, 33, 20, 23, 24, 37, 44, 27, 35, 34, 100, 31, 39, 38, 42, 43, 40, 41, 32, 50, 51, 53, 80, 25, 45, 46, 63, 47, 56, 57, 54, 55, 62, 61, 72, 59, 58, 52, 729, 69, 70, 71, 75
Offset: 1
Keywords
Examples
a(16) = 81 because this is the smallest unused k != 16, having the same number (5) of divisors as 16.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..16384
- Michael De Vlieger, Scatterplot of a(n), n = 1..1024, showing primes in red, composite prime powers in gold, squarefree composites in green, products of composite prime powers in magenta, and other numbers in blue. Powerful numbers are labeled unless they are less than 32.
- Index entries for sequences that are permutations of the natural numbers
Programs
-
Mathematica
Block[{a, c, k, t, u, nn}, nn = 68; c[] = False; a[1] = 1; c[1] = True; u = 2; Do[Set[{k, t}, {u, DivisorSigma[0, n]}]; While[Or[c[k], k == n, t != DivisorSigma[0, k]], k++]; Set[{a[n], c[k]}, {k, True}]; If[k == u, While[c[u], u++]], {n, 2, nn}]; Array[a, nn] ] (* _Michael De Vlieger, Dec 20 2022 *)
-
Python
from functools import lru_cache from sympy import divisor_count from itertools import count, islice @lru_cache(maxsize=None) def d(n): return divisor_count(n) def agen(): mink, seen = 2, {1} yield 1 for n in count(2): k = mink while k == n or k in seen or d(k) != d(n): k += 1 while mink in seen: mink += 1 yield k seen.add(k) print(list(islice(agen(), 68))) # Michael S. Branicky, Dec 13 2022
Formula
a(a(n)) = n.
a(prime(k)^(p-1)) = prime(k-1)^(p-1) for even k and prime p else prime(k+1)^(p-1). - Michael De Vlieger, Dec 20 2022
Extensions
More terms from Michael S. Branicky, Dec 13 2022
Comments