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.
For n=0, with factorial base representation (A007623) also 0, there are no nonzero digits, thus a(0) = 0. For n=2, with factorial base representation "10", there is one distinct nonzero digit, thus a(2) = 1. For n=3, with factorial base representation "11", there is just one distinct nonzero digit, thus a(3) = 1. For n=44, with factorial base representation "1310", there are two distinct nonzero digits ("1" and "3"), thus a(44) = 2.
a[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; Length[Union[Select[s, # > 0 &]]]]; Array[a, 100, 0] (* Amiram Eldar, Feb 07 2024 *)
from sympy import prime, primefactors from operator import mul import collections def a007623(n, p=2): return n if n
(define (A275806 n) (A001221 (A275735 n)))
n A007623(n) a(n) [highest number of times any nonzero digit occurs]. 0 = 0 0 (because no nonzero digits present) 1 = 1 1 2 = 10 1 3 = 11 2 4 = 20 1 5 = 21 1 6 = 100 1 7 = 101 2 8 = 110 2 9 = 111 3 10 = 120 1 11 = 121 2 12 = 200 1 13 = 201 1 14 = 210 1 15 = 211 2 16 = 220 2 17 = 221 2 18 = 300 1 and for n=63 we have: 63 = 2211 2.
a[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; Max[Tally[Select[s, # > 0 &]][[;;,2]]]]; a[0] = 0; Array[a, 100, 0] (* Amiram Eldar, Jan 24 2024 *)
from sympy import prime, factorint from operator import mul import collections def a007623(n, p=2): return n if n
For n=2, in factorial base "10", there is only one slope occupied by a single nonzero digit (1 is on the sub-maximal slope as 2-1 = 1), thus a(2) = 1. For n=3, in factorial base "11", there are two occupied slopes, each having just one digit present, thus a(3) = 2. For n=5, in factorial base "21", there is just one distinct occupied slope, but it contains two nonzero digits (2 and 1 both occupy the maximal slope as 2-2 = 1-1 = 0), thus there are no slopes with just one nonzero digit and a(5) = 0. For n=525, in factorial base "41311", there are three occupied slopes. The maximal slope contains the nonzero digits "3.1", the sub-maximal digits "4..1.", and the sub-sub-sub-maximal just "1..." (the 1 in the position 4 from right is the sole occupier of its own slope). Thus only one of the slopes is occupied by a lonely occupant and a(525) = 1.
For n=525, in factorial base "41311", there are three occupied slopes. The maximal slope contains the nonzero digits "3.1", the sub-maximal digits "4..1.", and the sub-sub-sub-maximal just "1..." (the 1 in the position 4 from right is the sole occupier of its own slope). Thus there are two slopes with more than one nonzero digit, and a(525) = 2. Equally, when we form a multiset of (digit-position - digit-value) differences for all nonzero digits present in "41311", we obtain a multiset [0, 0, 1, 1, 3], in which the distinct elements that occur multiple times are 0 and 1, thus a(525) = 2.
For n=525, in factorial base "41311", there are three occupied slopes. The maximal slope contains the nonzero digits "3.1", the sub-maximal the digits "4..1.", and the sub-sub-sub-maximal just "1..." (the 1 in the position 4 from right is the sole occupier of its own slope). There are two slopes with more than one nonzero digit, each having two such digits, and thus a(525) = 2+2 = 4. Equally, when we form a multiset of (digit-position - digit-value) differences for all nonzero digits present in "41311", we obtain a multiset [0, 0, 1, 1, 3], in which the elements that occur multiple times are [0, 0, 1, 1], thus a(525) = 4.
For n=23 ("321" in factorial base representation, A007623), all three nonzero digits are maximal for their positions (they all occur on "maximal slope"), thus the "maximal slope" is also the "maximally occupied slope" (as there are no other occupied slopes present), and a(23) = 3. For n=29 ("1021"), there are three nonzero digits, where both 2 and the rightmost 1 are on the "maximal slope", while the most significant 1 is on the "sub-sub-sub-maximal", thus here the "maximal slope" is also the "maximally occupied slope" (with 2 nonzero digits present), and a(29) = 2. For n=37 ("1201"), there are three nonzero digits, where the rightmost 1 is on the maximal slope, 2 is on the sub-maximal, and the most significant 1 is on the "sub-sub-sub-maximal", thus there are three occupied slopes in total, all with just one nonzero digit present, and a(37) = 1. For n=55 ("2101"), the least significant 1 is on the maximal slope, and the digits "21" at the beginning are together on the sub-sub-maximal slope (as they are both two less than the maximal digit values 4 and 3 allowed in those positions), thus here the sub-sub-maximal slope is the "maximally occupied slope" with its two occupiers, and a(55) = 2.
from sympy import prime, factorint from operator import mul from functools import reduce from sympy import factorial as f def a051903(n): return 0 if n==1 else max(factorint(n).values()) def a007623(n, p=2): return n if n0 else '0' for i in x])[::-1] return 0 if n==1 else sum([int(y[i])*f(i + 1) for i in range(len(y))]) def a275734(n): return 1 if n==0 else a275732(n)*a275734(a257684(n)) def a(n): return 0 if n==0 else a051903(a275734(n)) print([a(n) for n in range(201)]) # Indranil Ghosh, Jun 20 2017
For n=0, with factorial base representation (A007623) also 0, there are no nonzero digits, thus a(0) = 0. For n=2, with factorial base representation "10", there is one nonzero digit, thus a(2) = 1. For n=3 (= "11") there is no nonzero digit which would occur just once, thus a(3) = 0. For n=23 (= "321") there are three nonzero digits and each of those digits occurs just once, thus a(23) = 3. For n=44 (= "1310") there are two distinct nonzero digits ("1" and "3"), but only the other (3) occurs just once, thus a(44) = 1.
a[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; Count[Tally[Select[s, # > 0 &]][[;;,2]], 1]]; Array[a, 100, 0] (* Amiram Eldar, Feb 07 2024 *)
from sympy import prime, factorint from operator import mul from functools import reduce import collections def a056169(n): f=factorint(n) return 0 if n==1 else sum([1 for i in f if f[i]==1]) def a007623(n, p=2): return n if n
(define (A275948 n) (A056169 (A275735 n)))
from sympy import factorial as f def a007623(n, p=2): return n if n0 else '0' for i in x)[::-1] return 0 if n==0 else sum([int(y[i])*f(i + 1) for i in range(len(y))]) def a153880(n): x=(str(a007623(n)) + '0')[::-1] return 0 if n==0 else sum([int(x[i])*f(i + 1) for i in range(len(x))]) def a(n): return 0 if n==0 else a255411(a153880(a(n//2))) if n%2==0 else 1 + a255411(a153880(a((n - 1)//2))) print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 20 2017
Comments